Accessing Android Inbox/Messaging from Activity?

前端 未结 2 571
遇见更好的自我
遇见更好的自我 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:33

    If you want to open the messaging app to view messages and not for sending a message, this should do the job:

    Intent intent = new Intent(Intent.ACTION_MAIN);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
    intent.setPackage("com.google.android.apps.messaging");
    startActivity(intent);
    
    0 讨论(0)
  • 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 :-)

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