1狱从、跳轉(zhuǎn)Setting應(yīng)用列表(所有應(yīng)用)
Intent intent = new Intent(Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS);
this.startActivity(intent);
2、跳轉(zhuǎn)Setting應(yīng)用列表(安裝應(yīng)用)
Intent intent = new Intent(Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
3恼策、跳轉(zhuǎn)Setting應(yīng)用列表
Intent intent = new Intent(Settings.ACTION_APPLICATION_SETTINGS);
4劣欢、開發(fā)者選項(xiàng)
Intent intent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
5杉畜、允許在其它應(yīng)用上層顯示的應(yīng)用
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
6、無障礙設(shè)置
Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
7蹭秋、添加賬戶
Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
8扰付、WIFI設(shè)置
Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
9、藍(lán)牙設(shè)置
Intent intent = new Intent(Settings.ACTION_BLUETOOTH_SETTINGS);
10仁讨、移動(dòng)網(wǎng)絡(luò)設(shè)置
Intent intent = new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
11羽莺、日期時(shí)間設(shè)置
Intent intent = new Intent(Settings.ACTION_DATE_SETTINGS);
12、關(guān)于手機(jī)界面
Intent intent = new Intent(Settings.ACTION_DEVICE_INFO_SETTINGS);
13洞豁、顯示設(shè)置界面
Intent intent = new Intent(Settings.ACTION_DISPLAY_SETTINGS);
14盐固、聲音設(shè)置
Intent intent = new Intent(Settings.ACTION_SOUND_SETTINGS);
15、互動(dòng)屏保
Intent intent = new Intent(Settings.ACTION_DREAM_SETTINGS);
16丈挟、輸入法
Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS);
17刁卜、輸入法_SubType
Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS);
18、內(nèi)部存儲(chǔ)設(shè)置界面
Intent intent = new Intent(Settings.ACTION_INTERNAL_STORAGE_SETTINGS);
19曙咽、存儲(chǔ)卡設(shè)置界面
Intent intent = new Intent(Settings.ACTION_MEMORY_CARD_SETTINGS);
20蛔趴、語言選擇界面
Intent intent = new Intent(Settings.ACTION_LOCALE_SETTINGS);
21、位置服務(wù)界面
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
22例朱、運(yùn)營(yíng)商
Intent intent = new Intent(Settings.ACTION_NETWORK_OPERATOR_SETTINGS);
23孝情、NFC共享界面
Intent intent = new Intent(Settings.ACTION_NFCSHARING_SETTINGS);
24、NFC設(shè)置
Intent intent = new Intent(Settings.ACTION_NFC_SETTINGS);
25茉继、備份和重置
Intent intent = new Intent(Settings.ACTION_PRIVACY_SETTINGS);
26咧叭、快速啟動(dòng)
Intent intent = new Intent(Settings.ACTION_QUICK_LAUNCH_SETTINGS);
27、搜索設(shè)置
Intent intent = new Intent(Settings.ACTION_SEARCH_SETTINGS);
28烁竭、安全設(shè)置
Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);
29、設(shè)置的主頁
Intent intent = new Intent(Settings.ACTION_SETTINGS);
30吉挣、用戶同步界面
Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS);
31派撕、用戶字典
Intent intent = new Intent(Settings.ACTION_USER_DICTIONARY_SETTINGS);
32、IP設(shè)置
Intent intent = new Intent(Settings.ACTION_WIFI_IP_SETTINGS);
33睬魂、App設(shè)置詳情界面
public void startAppSettingDetail() {
String packageName = getPackageName();
Uri packageURI = Uri.parse("package:" + packageName);
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(packageURI);
startActivity(intent);
}
34终吼、跳轉(zhuǎn)應(yīng)用市場(chǎng)
public void startMarket() {
Intent intent = new Intent(Intent.ACTION_VIEW);
// intent.setData(Uri.parse("market://details?id=" + "com.xxx.xxx"));
intent.setData(Uri.parse("market://search?q=App Name"));
startActivity(intent);
}
35、獲取Launcherbaoming
public void getLauncherPackageName() {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
final ResolveInfo res = this.getPackageManager().resolveActivity(intent, 0);
if (res.activityInfo == null) {
Log.e("TAG", "沒有獲取到");
return;
}
if (res.activityInfo.packageName.equals("android")) {
Log.e("TAG", "有多個(gè)Launcher氯哮,且未指定默認(rèn)");
} else {
Log.e("TAG", res.activityInfo.packageName);
}
}
36际跪、跳轉(zhuǎn)圖庫獲取圖片
public void startGallery() {
Intent intent = new Intent(Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("image/*");
this.startActivityForResult(intent, 1);
}
37、跳轉(zhuǎn)相機(jī),拍照并保存
public void startCamera() {
String dir = Environment.getExternalStorageDirectory().getAbsolutePath() + "/test.jpg";
Uri headCacheUri = Uri.fromFile(new File(dir));
Intent takePicIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
takePicIntent.putExtra(MediaStore.EXTRA_OUTPUT, headCacheUri);
startActivityForResult(takePicIntent, 2);
}
38姆打、跳轉(zhuǎn)文件管理器
public void startFileManager() {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("file/*");
this.startActivityForResult(intent, 3);
}
39良姆、直接撥打電話
public void startCall() {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + "13843894038"));
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
return;
}
startActivity(callIntent);
}
40、跳轉(zhuǎn)電話應(yīng)用
public void startPhone() {
Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:" + "13843894038"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
41幔戏、發(fā)送短信
public void startSMS() {
Uri smsToUri = Uri.parse("smsto://10086");
Intent mIntent = new Intent( android.content.Intent.ACTION_SENDTO, smsToUri );
startActivity(mIntent);
}
42玛追、發(fā)送彩信
public void startMMS() {
Uri uri = Uri.parse("content://media/external/images/media/11");
Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra("sms_body", "some text");
it.putExtra(Intent.EXTRA_STREAM, uri);
it.setType("image/png");
startActivity(it);
}
43、發(fā)送郵件
public void startEmail() {
Uri uri = Uri.parse("mailto:6666666@qq.com");
String[] email = {"12345678@qq.com"};
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
intent.putExtra(Intent.EXTRA_CC, email); // 抄送人
intent.putExtra(Intent.EXTRA_SUBJECT, "這是郵件的主題部分"); // 主題
intent.putExtra(Intent.EXTRA_TEXT, "這是郵件的正文部分"); // 正文
startActivity(Intent.createChooser(intent, "請(qǐng)選擇郵件類應(yīng)用"));
}
44闲延、跳轉(zhuǎn)聯(lián)系人
public void startContact() {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Contacts.People.CONTENT_URI);
startActivity(intent);
/*Intent intent = new Intent();
intent.setAction(Intent.ACTION_PICK);
intent.setData(Uri.parse("content://contacts/people"));
startActivityForResult(intent, 5);*/
}
45痊剖、插入聯(lián)系人
public void insertContact() {
Intent intent = new Intent(Intent.ACTION_INSERT);
intent.setData(ContactsContract.Contacts.CONTENT_URI);
intent.putExtra(ContactsContract.Intents.Insert.PHONE, "18688888888");
startActivityForResult(intent, 1);
}
46、插入日歷事件
public void startCalender() {
Intent intent = new Intent(Intent.ACTION_INSERT);
intent.setData(CalendarContract.Events.CONTENT_URI);
intent.putExtra(CalendarContract.Events.TITLE, "開會(huì)");
startActivityForResult(intent, 1);
}
47垒玲、跳轉(zhuǎn)瀏覽器
public void startBrowser() {
Uri uri = Uri.parse("http://www.baidu.com");
Intent intent = new Intent(Intent.ACTION_VIEW,uri);
startActivity(intent);
}
48陆馁、安裝應(yīng)用
public void startInstall() {
String filePath="/xx/xx/abc.apk";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://" + filePath),
"application/vnd.android.package-archive");
startActivity(intent);
}
49、卸載應(yīng)用
public void startUnInstall() {
String packageName="cn.memedai.mas.debug";
Uri packageUri = Uri.parse("package:"+packageName);//包名合愈,指定該應(yīng)用
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageUri);
startActivity(uninstallIntent);
}
50氮惯、回到桌面
public void startLauncherHome() {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);
}
51、打開任意文件(根據(jù)其MIME TYPE自動(dòng)選擇打開的應(yīng)用)
private void openFile(File f) {
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.content.Intent.ACTION_VIEW);
String type = getMIMEType(f);
intent.setDataAndType(Uri.fromFile(f), type);
startActivity(intent);
}
private String getMIMEType(File f) {
String end = f.getName().substring(f.getName().lastIndexOf(".") + 1,
f.getName().length()).toLowerCase();
String type = "";
if (end.equalsIgnoreCase("mp3")
|| end.equalsIgnoreCase("aac")
|| end.equalsIgnoreCase("amr")
|| end.equalsIgnoreCase("mpeg")
|| end.equalsIgnoreCase("mp4")) {
type = "audio";
} else if(end.equalsIgnoreCase("mp4")
|| end.equalsIgnoreCase("3gp")
|| end.equalsIgnoreCase("mpeg4")
|| end.equalsIgnoreCase("3gpp")
|| end.equalsIgnoreCase("3gpp2")
|| end.equalsIgnoreCase("flv")
|| end.equalsIgnoreCase("avi")) {
type = "video";
} else if (end.equalsIgnoreCase("jpg")
|| end.equalsIgnoreCase("gif")
|| end.equalsIgnoreCase("bmp")
|| end.equalsIgnoreCase("png")
|| end.equalsIgnoreCase("jpeg")) {
type = "image";
} else {
type = "";
}
type += "/";
return type;
}
52想暗、跳轉(zhuǎn)錄音
public void startRecord() {
Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
startActivity(intent);
}