How to use putExtra() with FLAG_ACTIVITY_REORDER_TO_FRONT in Android Apps?

前端 未结 1 790
自闭症患者
自闭症患者 2021-02-07 01:24

I have an application, call \"App1\". In my App1 I invoke Camera application.

intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName(\"co         


        
1条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 01:31

    You need to override Activity.onNewIntent() method.

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        setIntent(intent);
    }
    

    After onNewIntent() is called, the normal onResume() lifecycle will follow. Alternatively, you can write your code in onNewIntent() itself.

    0 讨论(0)
提交回复
热议问题