如何完成库中的活动并返回父应用程序?

时间:2018-08-21 19:00:14

标签: android android-activity

我正在编写一个库,当用户执行某些操作时,该库将启动一系列活动。如果从不按下后退,则流程应为:

  • 使用库的应用程序检测到对ParentAppScreen1的某些操作>
  • LibraryActivity1:用户点击下一步>
  • LibraryActivity2:用户点击发送>
  • 用户返回到ParentAppScreen1

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            // Respond to the action bar's Up/Home button
            case android.R.id.home:
                this.finish();
                return true;
    
            case R.id.action_send:
                sendReport();
    
                // TODO go back to where the user started in parent app
        }
    
        return super.onOptionsItemSelected(item);
    
    }
    

对此有任何标准做法吗?浏览文档时找不到很多东西,也不确定从哪里开始。

0 个答案:

没有答案