Android Development Intent jump to the dial-up interface, contact interface, SMS interface in the system application

Source: Internet
Author: User

Now the development of functions need to jump directly to dial, contact, SMS interface and so on, find a lot of information, self-organized a bit.
1, jump to the dial-up interface, the code is as follows:

1) Call directly

  1. Intent Intentphone = new Intent (Intent. Action_call, Uri. Parse ("Tel:" + phonenumber));

    StartActivity (Intentphone);

  2. 2) Jump to dial-up interface
  3. Intent Intent = newIntent (Intent. Action_dial, Uri. Parse ("Tel:" + phonenumber));

    Intent.setflags (Intent. Flag_activity_new_task);

    StartActivity (Intent);
  4. 2, jump to the contact page, use the code:

      1. Intent Intentphone = new Intent (Intent. Action_call, Uri. Parse ("Tel:" + phonenumber));
        StartActivity (Intentphone);
     The following content is reproduced: Android Development Intent jump to the dial-up interface, contact interface, SMS interface in the system application
    Now the development of functions need to jump directly to dial, contact, SMS interface and so on, find a lot of information, self-organized a bit.

    // install an already existing apk

    String filepath= "mnt/sdcard/abc.apk";

    Intent Intent = new Intent (Intent.action_view);

    Intent.setdataandtype (Uri.parse ("file://" + FilePath),

    "Application/vnd.android.package-archive");

    StartActivity (Intent); // jump directly to the installation page, but also click the button to confirm the installation or cancel the installation

    // Uninstall an app

    String packagename= "Org.adw.launcher2"

    Uri Packageuri = Uri.parse ("package:" +packagename); // package name, specifying the app

    Intent uninstallintent = new Intent (Intent.action_delete, Packageuri);

    StartActivity (uninstallintent);

    // View information for an application

    Uri uri=uri.parse ("package:" +packagename); // package name, specifying the app

    Intent intent=New Intent ("Android.settings.APPLICATION_DETAILS_SETTINGS", URI);

    StartActivity (Intent);

    2. Browse the Web page for a specific URL

    Uri uri = uri.parse ("http://xxxxxxxxxxxxxxxxxxxxxxxx");

    Intent Intent = new Intent (Intent.action_view,uri);

    // Add the following sentence is to start the system comes with the browser to open the above URL, Without the following sentence, If you have more than one browser, it will pop up to let you choose a browser, and then change the browser will open the URL ...

    Intent.setclassname ("Com.android.browser", "com.android.browser.BrowserActivity");

    StartActivity (Intent);

    // system setup interface

    Intent intent=New Intent ();

    Intent.setclassname ("Com.android.settings", "com.android.settings.Settings");

    StartActivity (Intent);

    // back to the table?

    Intent Intent = new Intent (Intent.action_main);

    Intent.addcategory (Intent.category_home);

    StartActivity (Intent);

    // system Dial-up interface

    Intent intent= New Intent (intent.action_dial);

    Intent.setclassname ("Com.android.contacts", "com.android.contacts.DialtactsActivity");

    StartActivity (Intent);

    // system Call History Interface

    Intent Intent =new Intent ();

    Intent.setaction ("Android.intent.action.CALL_BUTTON");

    StartActivity (Intent);

    // dialing

    Uri uri = uri.parse ("tel:xxxxxx");

    Intent Intent = new Intent (intent.action_dial, URI);

    StartActivity (Intent);

    // starts the dial-up interface, specifying the class name the package name is the dial-up interface of the system dialtactsactivity

    Intent intent= New Intent ("Android.intent.action.DIAL");

    Intent.setclassname ("Com.android.contacts", "com.android.contacts.DialtactsActivity");

    StartActivity (Intent);

    // system Contact Interface peopleactivity

    Intent intent001 = new Intent ();

    Intent001.setclassname ("Com.android.contacts", "com.android.contacts.activities.PeopleActivity");

    StartActivity (intent001);

    // system search interface searchactivity

    Intent intent002=New Intent ();

    Intent002.setclassname ("Com.android.quicksearchbox", "com.android.quicksearchbox.SearchActivity");

    StartActivity (intent002);

    // start the SMS Inbox interface , Specifies the package name, the class name

    Intent intent4 = new Intent ();

    Intent4.setclassname ("Com.android.mms", "com.android.mms.ui.ConversationList");

    StartActivity (INTENT4);

    // Start the contact interface, not good

    Intent Intent = new Intent ();

    Intent.setaction (Intent.action_pick);

    Intent.setdata (Contacts.People.CONTENT_URI);

    StartActivity (Intent); Insert Contact
    Intent intent=NewIntent (Intent.action_edit,uri.parse ("content://com.android.contacts/contacts/" + "1"));
    StartActivity (Intent);
     to the Contact list interface
    Intent Intent = new Intent (Intent.action_insert_or_edit);
    Intent.settype ("Vnd.android.cursor.item/person");
    Intent.settype ("Vnd.android.cursor.item/contact");
    Intent.settype ("Vnd.android.cursor.item/raw_contact");
    Intent.putextra (Android.provider.ContactsContract.Intents.Insert.NAME, NAME);
    Intent.putextra (Android.provider.contactscontract.intents.insert.company,company);
    Intent.putextra (Android.provider.ContactsContract.Intents.Insert.PHONE, tel);
    Intent.putextra (Android.provider.ContactsContract.Intents.Insert.PHONE_TYPE, 3);
    // start the SMS Inbox interface , Specifies the package name, the class name
    Intent Intent = new Intent ();
    Intent.setclassname ("Com.android.mms", "com.android.mms.ui.ConversationList");
    StartActivity (Intent);
    // start the edit SMS interface
    Intent Intent = new Intent (Intent.action_view);
    Intent.settype ("vnd.android-dir/mms-sms");
    //Intent.setdata (Uri.parse ("content://mms-sms/conversations/"));// This is the number
    StartActivity (Intent);
     Turn from:Http://my.eoe.cn/803369/archive/1641.html

    1, transfer the phone interface and broadcast the specified number, but not typed
    Uri Teluri = Uri.parse ("tel:100861");
    Returnit = new Intent (intent.action_dial, Teluri);

    2. Direct phone calls
    Uri Calluri = Uri.parse ("tel:100861");
    Returnit = new Intent (Intent.action_call, Calluri);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.