从 ActivityManager 启动活动时出现问题
我正在开发一个 Android 项目,其中有一个要填充的列表视图。它发生在组活动中,其中意图被传递到控制器,并且活动从该控制器开始使用指定的意图。 在通过调试识别问题时,我发现调试器卡在指定的行中:
**View view = activityManager.startActivity(intentId, intent).getDecorView();**
并且列表视图永远不会被填充,但是当我检查必须从中填充项目的数组时,这表明它包含这些项目。一件有趣的事情是,当我关闭应用程序并重新启动它然后查看列表视图时,它显示得很好。这对我来说很奇怪。为什么第一次不出现,第二次又出现。整个函数有以下代码:
public void startGroupActivity(String intentId, Intent intent) {
contentViewLayout.removeAllViews();
Log.e("Start Group Actvity", intentId);
View view = activityManager.startActivity(intentId, intent).getDecorView();
contentViewLayout.addView(view, contentViewLayoutParams);
}
这种行为对我来说简直无法理解。任何帮助表示赞赏。
I am working on an android project, where i have got a list view to be populated. It happens in a group activity where intent is passed to a controller and from that controller the activity starts using specified intent.
In identifying the issue through debugging, i got that the debugger gets stuck in the line specified:
**View view = activityManager.startActivity(intentId, intent).getDecorView();**
and the list view never gets populated, however the when i check the array from which i have to populate items, that shows me that it contains the items. One interesting thing is that, when i close the application, and restart it and then see the list view, it shows up fine. This is strange for me. Why does it not show up first time and show up second time. the whole function has the following code:
public void startGroupActivity(String intentId, Intent intent) {
contentViewLayout.removeAllViews();
Log.e("Start Group Actvity", intentId);
View view = activityManager.startActivity(intentId, intent).getDecorView();
contentViewLayout.addView(view, contentViewLayoutParams);
}
That behavior is simply un-understandable for me. Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论