【问题标题】:Eclipse-Changing startup activityEclipse-改变启动活动
【发布时间】:2014-03-06 18:24:10
【问题描述】:

我在 Eclipse (Android SDK) 中有两个活动,分别名为 Mainactivity 和 S2。默认情况下,Mainactivity 是执行的,但我想先运行活动 S2,然后再运行 Mainactivity。怎么做?我是一名业余的android开发人员,具有java基础知识。!所以请帮我做!

【问题讨论】:

    标签: android eclipse android-activity


    【解决方案1】:

    更改您的 AndroidManifest 文件: 在activity里面的android名字中,给package名字加上activity的名字“S2” android:name="com.example.S2"

    你可以在清单中看到包名:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example"
        android:versionCode="1"
        android:versionName="1.0" >
      <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:name="com.example.S2"
                android:label="@string/app_name" 
                android:windowSoftInputMode="adjustResize">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-28
      • 1970-01-01
      • 2020-01-10
      • 2013-04-02
      • 1970-01-01
      相关资源
      最近更新 更多