Android ActivityGroup 活动意图导航
我面临着与活动组非常复杂的问题。在我的应用程序中,我使用了 ActivityGroup。对于我使用的其他活动导航:
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);}
我的问题是,一旦我在另一个屏幕上导航,现在如果我再次进行相同的导航而不更改活动,则会出现以下错误:
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?
I am facing very complicated issue with Activity Group. In my application I have used 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
另外
,ActivityGroup 类现已弃用。为此目的使用 Fragment 会更好、更容易。请参阅http://developer.android.com/guide/topics/fundamentals/fragments。 html。
Try
Also, ActivityGroup class is deprecated now. It is better and easier to use Fragments for this purpose. Refer http://developer.android.com/guide/topics/fundamentals/fragments.html.