My question is that from our application can we go to the Default SMS Screen/Phonebook
For example :- I create tabbar with three tab (Inbox,Phonebook,Group).To press Inbox I want to go the default SMS screen which is provided by Android or To press Phonebook I want to go the phonebook screen which is provided by Android.
Is this possible?
Thanks
For PhoneBook you can startActivity with intent ACTION_VIEW;
Intent intent = new Intent(Intent.ACTION_VIEW, ContactsContract.Contacts.CONTENT_URI);
startActivity(intent);
For inbox see this today's answer how can i read inbox in android mobile?
Related
I am able to make a call using,
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse("tel:" + "911"));
startActivity(intent);
But I am required to update emergency contact in Android programatically from my app. Is there any way to update emergency contact from any app other than from default contact app? By update I mean add, delete and modify any emergency contact.
Here is one post, where they discussed how to update contact, but in my case, I need to update the emergency contact not a normal contact.
There is no way to modify emergency information until now. However any app can ask user to edit info using ACTION_VIEW or ACTION_EDIT.
Intent intent = new Intent(Intent.ACTION_VIEW, ContactsContract.Profile.CONTENT_URI);
MainActivity.this.startActivity(intent);
Im developing an application where in I have 2 text views and a button.
when I click the button, it should open default system contacts application and upon selecting a contact, it should display the name and number in the text fields respectively.
Now I have implemented ContactsContract and getContentResolver. But, I have seen other apps having this feature, which is quite easy because you need not create a list view and stuffs.
Now how do I start? how do I invoke default contact app and retrieve data from it.
I don't know the details about your problem, but I am pretty sure that you need to use an Implicit Intent (because the Contacts app may be different on different devices). Hopefully this page will help.
You may need to start by using this code:
Intent i = new Intent(); // Declare intent
// Start the intent
startActivity(i);
You may want to use ACTION_GET_CONTENT.
Thanks for the replies. I found out that this is what i need.
Intent localIntent = new Intent("android.intent.action.PICK",ContactsContract.Contacts.CONTENT_URI);
How to call Android contacts app inside an activity. The activity may contains other controls like button, but somewhere (inside the same activity) it displays the contacts app so that i can perform certain actions like add, view, edit etc. By actions, i mean the actions that Android contacts app provides. Following code calls android contacts app as an intent:
Intent i = new Intent();
i.setComponent(new ComponentName("com.android.contacts", "com.android.contacts.DialtactsContactsEntryActivity"));
i.setAction("android.intent.action.MAIN");
i.addCategory("android.intent.category.LAUNCHER");
i.addCategory("android.intent.category.DEFAULT");
startActivity(i);
It does not work like this. You can not add another app inside your app. You can use Content Providers for app functionality with contacts (e.g. to add/edit/remove contacts progmatically). or use intents with action View, Edit or Pick to handle the contact inside the contact application itself.
I developed a dial up application and I installed it to my phone. Now I want to "on click a button" in my app to set the built in dialer as the default dialing application "automatically" without giving the user to choose between my app and the default dialer application.
This code gives the user the choice,
startActivityForResult(new Intent("android.intent.action.DIAL",
Uri.parse("tel:" + someNumber)), 1);
I don't want this, I want to set the default application to be built in dialer without asking the user.
Note: Once the user is not using my app he will be given the choice, Howevre, if he clicked that button in my app .. it will set the default app automatically.
Try this. This should open default dialer .
Intent i = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:0000000000"));
startActivity(i);
You can't force the default activity without user interaction. Why don't you just call your class directly on the button press?
Intent intent = new Intent(this, mydialer.class))
intent.putExtra("PHONENUMBER", _phoneNumber);
startActivityForResult(intent);
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, and it opens the Android Messaging app just like as if I was to press the Messaging icon on the main screen.
I did something similar to this with the Contacts activity, but only the contact list comes up, no extra functionality like Adding/Modifying/Deleting, etc.
Any ideas?
edit: I found this way to open the "Compose New Message" Activity, I just need to back it up a step. Does anyone know the correct MIME type instead of this one?
Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.setType("vnd.android-dir/mms-sms");
m_activity.startActivity(sendIntent);
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 :-)
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);