How to call an activity in another project?

前端 未结 5 675
无人及你
无人及你 2021-01-18 22:22

Hi I am new to android and I have created 2 projects.

Now I want to call an activity in the second project from the first project upon a button click.

The 1

5条回答
  •  离开以前
    2021-01-18 22:57

    Use this:

    Intent i = new Intent(Intent.ACTION_MAIN);
    i.setComponent(new ComponentName("app package name", "app launch activity's classname"));
    i.addCategory(Intent.CATEGORY_LAUNCHER);
    startActivity(i);
    

提交回复
热议问题