问题描述
我有上有一个preference一个preferenceActivity。当preference启动使用startActivity的活性,则preferenceActivity由OS停止和去除。
我想用户返回到原来的preferenceActivity代替具有它由操作系统完成并除去的
操作系统是消除活动,但我不知道为什么。我怎么能告诉这里的/这code呼吁我的活动结束?
@覆盖
保护无效的onClick(){
// TODO自动生成方法存根
super.onClick(); 日志(点击); 意图sintent =新意图(背景下,音乐prefActivity.class);
context.startActivity(sintent);} <活动
机器人:名字=。UI prefs.Roku prefActivity
机器人:screenOrientation =画像
机器人:主题=@安卓风格/ Theme.NoTitleBar>
&所述;意图滤光器>
<作用机器人:名字=android.intent.action.MAIN/>
&所述; /意图滤光器>
< /活性GT;
<活动
机器人:名字=。UI prefs.Music prefActivity
机器人:screenOrientation =画像
机器人:主题=@安卓风格/ Theme.NoTitleBar>
&所述;意图滤光器>
<作用机器人:名字=android.intent.action.MAIN/>
&所述; /意图滤光器>
< /活性GT;
我是个白痴-1给我。我设置的意图NO_HISTORY标志
我知道这是一个历史问题,我应该已经张贴code和它本来是显而易见的。
I have a PreferenceActivity that has a Preference on it. When the preference launches an activity using startActivity, the PreferenceActivity is stopped and removed by the OS.
I would like the user to return to the original PreferenceActivity instead of having it be finished and removed by the operating system.
The OS is removing the activity but I cannot tell why. HOw can I tell where/which code is calling finish on my activity?
@Override
protected void onClick() {
// TODO Auto-generated method stub
super.onClick();
log("click");
Intent sintent = new Intent(context, MusicPrefActivity.class);
context.startActivity(sintent);
}
<activity
android:name=".ui.prefs.RokuPrefActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name=".ui.prefs.MusicPrefActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
I'm an idiot -1 to me. I was setting NO_HISTORY flag on intentI knew it was a history issue, I should have posted code and it would have been obvious.
这篇关于Android是从历史堆栈当另一个活动启动删除我的自定义preferenceActivity。我怎么能停止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!