本文整理汇总了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);
}