在Android的第二意图后,我的程序停止 [英] My Program stops after 2nd intent in android

查看:137
本文介绍了在Android的第二意图后,我的程序停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Andr​​oid应用我的第二个意图的 startActivity()拨打后停止。它完美的作品首次与意图。但在第二次的控制不会传递到第三个活动。我还没有显示在第二个活动什么。这是不是问题?或者是我的的Andr​​oidManifest.xml 文件的东西吗?
有人能帮我吗?
我加入的三项活动的意图过滤器,如图below.Is它的问题?我是新至Android所以请帮助我!

 <意向滤光器>
     <作用机器人:名字=android.intent.action.MAIN/>
     <类机器人:名字=android.intent.category.LAUNCHER/>
 &所述; /意图滤光器>


解决方案

有关的任​​何活动不是主要的一个使用以下内容:

 <类机器人:名字=android.intent.category.DEFAULT/>

只有原来的活动应具备以下条件:

 <类机器人:名字=android.intent.category.LAUNCHER/>

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>

解决方案

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" />

这篇关于在Android的第二意图后,我的程序停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆