startActivityForResult from ActivityGroup

自闭症网瘾萝莉.ら 提交于 2020-01-16 19:28:05

问题


I am using ActivityGroup. I use the following code from ActivityGroup in order to replace view and launch a new activity.

Intent i = new Intent(SummaryCostScreen.this,PermissionsScreen.class);
replaceContentView("activity1",i);

public void replaceContentView(String id, Intent newIntent) {
    View view = getLocalActivityManager().startActivity(id, 
    newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();
}

The problem with the above code is that, I need to have startActivityForResult in place of startActivity, since I need to update the UI of launcher activity when coming back from the launched activity.

getLocalActivityManager() does not have startActivityForResult. How should I address this situation, such that, I am able to update UI from onActivityResult?

Any help is much appreciated.

PS: I cannot change the replaceContentView approach for launching new screen, since that has been used at numerous other places and this is the only scenario in which I need to call startActivityForResult


回答1:


Converting comments as answer, Try using onResume() to update UI of SummerCostScreen



来源:https://stackoverflow.com/questions/16558628/startactivityforresult-from-activitygroup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!