我的程序本来是将MainActivity作为程序主入口,代码如下
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:value="xxxxxxxxxxxxxxxxxxxx" />
<activity
android:name=".activity.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.SearchActivity" />
<activity android:name=".activity.LoginActivity" />
<activity android:name=".activity.RegisterActivity"/>
<service
android:name="com.baidu.location.f"
android:enabled="true"
android:process=":remote" />
</application>
现在想将 LoginActivity 作为程序的主入口,将代码改成这样
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:value="xxxxxxxxxxxxxxxxxx" />
<activity
android:name=".activity.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
</activity>
<activity android:name=".activity.SearchActivity" />
<activity android:name=".activity.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.RegisterActivity"/>
<service
android:name="com.baidu.location.f"
android:enabled="true"
android:process=":remote" />
</application>
结果现在一安装运行就提示 程序已停止运行
Where is your error log? In theory, there will be no problem simply changing the entry. Your LoginActivity should be abnormal.
I agree with the opinion above. It should not be a problem with the registration file, but an exception in the java code.
Look at the error log exported by logcat and upload it.
How to solve the problem if there is no log/...
Post the log for everyone to see