My Program stops after 2nd intent in android

孤街醉人 提交于 2019-12-24 06:42:04

问题


My android application stops after startActivity () call of my 2nd intent. It works perfectly for the first time with intents. But on the 2nd time its control doesn't pass to 3rd activity. I haven't displayed anything on 2nd activity. Is it the problem? Or is something with my AndroidManifest.xml file? Can some one help me? I have added the intent filter of three activities as shown below.Is it the problem? I am new to android so please help me!

 <intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
 </intent-filter>

回答1:


For any activity that isn't the main one use the following:

<category android:name="android.intent.category.DEFAULT" /> 

Only the original activity should have the following:

 <category android:name="android.intent.category.LAUNCHER" />


来源:https://stackoverflow.com/questions/9482596/my-program-stops-after-2nd-intent-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!