Access to Incoming / Outgoing Email in Android?

Is it possible to open the default activity for Android messages due to an action you write yourself? For example, I click the Mail button inside my program and open the Android Messaging application just as if I clicked the Messages icon on the main screen.

I did something similar to this with the activity of contacts, but only the list of contacts appears, there are no additional functions, such as adding / changing / deleting, etc.

Any ideas?

edit: I found this way to open the "Create a new message" action, I just need to backup this step. Does anyone know the correct MIME type instead?

Intent sendIntent = new Intent(Intent.ACTION_VIEW); 
sendIntent.setType("vnd.android-dir/mms-sms"); 
m_activity.startActivity(sendIntent); 
+1
source share
2 answers

Launches a messaging application from another application:

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

Just place it inside the button listener or any other user from whom you want to open it.

Enjoy :-)

+3
source

If you want to open a messaging application to view messages, and not to send a message, this should complete the task:

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setPackage("com.google.android.apps.messaging");
startActivity(intent);
0
source

Source: https://habr.com/ru/post/1756214/


All Articles