[英]Android ActivityGroup activity intent navigation
I am facing very complicated issue with Activity Group. 我面临的活动组非常复杂的问题。 In my application I have used ActivityGroup.
在我的应用程序中,我使用了ActivityGroup。 With other activity navigation I used:
在其他活动导航中,我使用了:
Intent activityIntent = new Intent(v.getContext(), Reschedule.class);
activityIntent.putExtra("dialog_selcted_Appointment_date_time", selected_date +" "+ selected_time);
replaceContentView("activity3", activityIntent);
private void replaceContentView(String id, Intent newIntent) {
View view = this.getLocalActivityManager().startActivity(id,newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)) .getDecorView(); this.setContentView(view);}
My issue is, once I navigate on the other screen this this intent now if one more time I will make the same navigation without changing the activity then it gives an error of: 我的问题是,一旦我在另一个屏幕上导航,便会再次出现此意图,如果再进行一次相同的导航而不更改活动,则会出现以下错误:
02-23 18:16:15.200: E/ACRA(2433):
Caused by: android.view.WindowManager$BadTokenException: Unable to add window --
token android.app.LocalActivityManager$LocalActivityRecord@44f04458 is not valid; is your activity running?
Try 尝试
View view = getApplicationContext().startActivity(id,newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)) .getDecorView(); this.setContentView(view);}
Also, ActivityGroup class is deprecated now. 此外,现在不推荐使用ActivityGroup类。 It is better and easier to use Fragments for this purpose.
为此目的,使用片段更好,更容易。 Refer http://developer.android.com/guide/topics/fundamentals/fragments.html .
请参阅http://developer.android.com/guide/topics/fundamentals/fragments.html 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.