2

如果问题有点模糊,我想提前道歉,但我很难提供代码的特定部分来负责正在发生的事情。

我扩展了 BaseExpandableListAdapter 以在我的一个活动 (StreamActivity) 中使用以填充 ExpandableListView。此活动是活动组的一部分。然后,事实证明我需要一个非常相似的适配器来用于不属于组的不同 Activity (StreamUserActivity)。我决定进一步扩展我的自定义适配器,并且只覆盖某些不同的方法。两个适配器的行结构背后的逻辑是相同的。

但是,当我使用第二个适配器(用于独立 Activity 的适配器)时,当我调用 notifyDataSetChanged() 时,在列表更新之前屏幕变黑。在某些情况下,它只是暂时的眨眼,有时会保持这种状态。然后,如果我滚动列表,它会再次出现,但 ExpandableListView 上方的元素不会再次出现。尽管如此,我仍然可以触摸该元素中的活动元素,它会按计划将我转移到另一个活动。

StreamUserActivity 通过以下方式从 StreamActivity 中启动:

Intent streamUserProfiletIntent = new Intent(this, StreamUserProfileActivity.class);
streamUserProfiletIntent.putExtra(StreamUserProfileActivity.USER_JID,
OpenfireRosterProvider.getInstance(getApplicationContext()).getCurrentUser().getJabberId());
startActivity(streamUserProfiletIntent);

这会导致屏幕变黑。但是,如果我这样开始:

Intent streamUserProfiletIntent = new Intent(this, StreamUserProfileActivity.class);
streamUserProfiletIntent.putExtra(StreamUserProfileActivity.USER_JID,
OpenfireRosterProvider.getInstance(getApplicationContext()).getCurrentUser().getJabberId());
startChildActivity("StreamUserProfiletIntent", streamUserProfiletIntent);

...没有闪烁,但新的 Activity 是 ActivityGroup 的一部分,这不是我需要的。

关于是什么导致这个问题的任何想法?代码的哪一部分可能对此负责,以便我可以分享它。

4

0 回答 0