Accessing Android Inbox/Messaging from Activity?

前端 未结 2 572
遇见更好的自我
遇见更好的自我 2021-01-15 22:19

Is it possible to open up the default Android Messaging activity from inside an activity you write yourself? Like for example: I press a \"Mail\" button inside my program,

2条回答
  •  攒了一身酷
    2021-01-15 22:35

    This starts the messaging app from another app:

    Intent intent = new Intent("android.intent.action.MAIN");
    intent.setComponent(new ComponentName("com.android.mms","com.android.mms.ui.ConversationList"));
    startActivity(intent);
    

    Just put it inside a button listener or whatever user input you want to open it from.

    Enjoy :-)

提交回复
热议问题