本文整理匯總了Java中android.provider.Settings.ACTION_SETTINGS屬性的典型用法代碼示例。如果您正苦於以下問題:Java Settings.ACTION_SETTINGS屬性的具體用法?Java Settings.ACTION_SETTINGS怎麽用?Java Settings.ACTION_SETTINGS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.provider.Settings
的用法示例。
在下文中一共展示了Settings.ACTION_SETTINGS屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_widget) {
selectWidget();
return true;
}else if(id == R.id.action_settings){
SettingsActivity.apps = WeakApp.from(apps);
startActivityForResult(new Intent(this, SettingsActivity.class), 101);
return true;
}else if(id ==R.id.action_shortcut){
startActivityForResult(new Intent(Intent.ACTION_CREATE_SHORTCUT),119);
return true;
}else if(id == R.id.action_system_settings){
Intent intent = new Intent(Settings.ACTION_SETTINGS);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}else Toast.makeText(this, "Settings could not be opened", Toast.LENGTH_SHORT).show();
return true;
}
if (drawerToggle.onOptionsItemSelected(item)) {
return true;
}
return super.onOptionsItemSelected(item);
}
示例2: showNonetLayout
public void showNonetLayout(View.OnClickListener refreshListener) {
final View.OnClickListener settingListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Settings.ACTION_SETTINGS);
// // 判斷手機係統的版本 即API大於10 就是3.0或以上版本及魅族手機
// if (Build.VERSION.SDK_INT > 10 && !Build.MANUFACTURER.equals("Meizu")) {
// intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
// } else if (Build.VERSION.SDK_INT > 17 && Build.MANUFACTURER.equals("Meizu")) {
// //魅族更高版本調轉的方式與其它手機型號一致 可能之前的版本有些一樣 所以另加條件(tsp)
// intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
// } else {
// intent = new Intent(Settings.ACTION_SETTINGS);
//// intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
//// intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
//// ComponentName component = new ComponentName("com.android.settings", "com.android.settings.WirelessSettings");
//// intent.setComponent(component);
//// intent.setAction("android.intent.action.VIEW");
// }
mActivity.startActivity(intent);
}
};
showNonetLayout(settingListener, refreshListener);
}
示例3: openDefaultSettings
public static void openDefaultSettings(Context context) {
Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS);
settingsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(settingsIntent);
}
示例4: startWifiSetting
/**
* 打開網絡設置界麵
*/
public static void startWifiSetting() {
//也可以直接用ACTION_WIRELESS_SETTINGS打開到wifi界麵
Intent intent = new Intent(Settings.ACTION_SETTINGS);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
UtilManager.getContext().startActivity(intent);
}
示例5: SystemConfig
/**
* 係統設置界麵
* @param activity
*/
public static void SystemConfig(Activity activity) {
Intent intent = new Intent(Settings.ACTION_SETTINGS);
activity.startActivity(intent);
}