Android App Call:
Intent intent=new Intent (Intent.action_dial,uri.parse ("Tel:" +110));
StartActivity (Intent);
}
Android app opens phone book:
Intent Intent = new Intent (Intent.action_pick,contactscontract.contacts.content_uri);
StartActivity (Intent);
Android App SMS Sharing:
Intent sendintent = new Intent (Intent.action_view);
Sendintent.putextra ("Sms_body", "#短信分享 #");
Sendintent.settype ("vnd.android-dir/mms-sms");
StartActivity (sendintent);
To turn on your phone's sharing features:
Intent sendintent = new Intent (intent.action_ SEND);
// Sendintent.settype ("image/png");//Picture
// file F = new file (environment.getexternalstoragedirectory () +"/pictures/2.png ");
// Uri u = uri.fromfile (f);
// Sendintent.putextra (intent.extra_stream, u);
sendintent.settype ("Text/plain");//text
Sendintent.putextra (Intent.extra_subject," #好友分享 # ");
Send details of your own unsolicited join
Sendintent.putextra (Intent.extra_text, "I'm playing the app now, add it together.") Many other information see: http://www.xx.com ");
Sendintent.setflags (Intent.flag_activity_new_task);
StartActivity (Intent.createchooser (Sendintent, GetTitle ()));
Open the store for evaluation:
Uri uri=uri.parse ("Market://details?")
Id= "+ Activity.this.getPackageName ());
Intent intent=new Intent (Intent.action_view, URI);
Packagemanager pm = SettingActivity.this.getPackageManager ();
list<resolveinfo> list = pm.queryintentactivities (intent, 0);
if (List.size () ==0) {
Toast.maketext (settingactivity.this, "software store not Installed", Toast.length_short). Show ();
}else{
StartActivity (Intent);
}
To Create a desktop shortcut icon:
To send the broadcast intent, to create a shortcut icon
Intent Intent = new Intent ();
Intent.setaction ("Com.android.launcher.action.INSTALL_SHORTCUT");
Shortcut to include 3 important information 1, Name 2. Icon 3. What to Do
Intent.putextra (Intent.extra_shortcut_name, "Aberdeen mobile phone security defender");
Intent.putextra (Intent.extra_shortcut_icon, Bitmapfactory.decoderesource (Getresources (), R.drawable.ic_launcher) );
Desktop click on the icon corresponding to the intent.
Intent shortcutintent = new Intent ();
Shortcutintent.setaction ("Android.intent.action.MAIN");
Shortcutintent.addcategory ("Android.intent.category.LAUNCHER");
Shortcutintent.setclassname (Getpackagename (), "com.zaizai.safty.MainActivity");
Intent.putextra (Intent.extra_shortcut_intent, shortcutintent);
Sendbroadcast (Intent);
Need to add permission
Com.android.launcher.permission.INSTALL_SHORTCUT
MIME Type comparison table: Http://tool.oschina.net/commons http://blog.sina.com.cn/s/blog_446cc66b0100ublv.html
Android app code to make a phone call, turn on the phone sharing function and other implicit intentions