本文整理汇总了Java中android.provider.Settings.Secure.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java Secure.getInt方法的具体用法?Java Secure.getInt怎么用?Java Secure.getInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.provider.Settings.Secure
的用法示例。
在下文中一共展示了Secure.getInt方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLocationEnabled
import android.provider.Settings.Secure; //导入方法依赖的package包/类
private boolean isLocationEnabled() {
int locationMode = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
try {
locationMode = Secure.getInt(mContext.getContentResolver(), Secure.LOCATION_MODE);
} catch (SettingNotFoundException e) {
e.printStackTrace();
}
return locationMode != Secure.LOCATION_MODE_OFF;
} else {
return isLocationEnabled_Deprecated();
}
}
示例2: isLocationEnabled
import android.provider.Settings.Secure; //导入方法依赖的package包/类
public static boolean isLocationEnabled(Context context) {
int locationMode = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
try {
locationMode = Secure.getInt(context.getContentResolver(), Secure.LOCATION_MODE);
} catch (SettingNotFoundException e) {
e.printStackTrace();
}
return locationMode != Secure.LOCATION_MODE_OFF;
} else {
String locationProviders = Secure.getString(context.getContentResolver(),
Secure.LOCATION_PROVIDERS_ALLOWED);
return !locationProviders.isEmpty();
}
}
示例3: b
import android.provider.Settings.Secure; //导入方法依赖的package包/类
@SuppressLint({"NewApi"})
public int b() {
if (this.c != 0) {
return this.c;
}
if (VERSION.SDK_INT >= 17) {
this.c = Global.getInt(this.b.getContentResolver(), "device_provisioned", 0);
return this.c;
}
this.c = Secure.getInt(this.b.getContentResolver(), "device_provisioned", 0);
return this.c;
}
示例4: canSideLoad
import android.provider.Settings.Secure; //导入方法依赖的package包/类
public boolean canSideLoad(){
try {
int installNonMarketApps = Secure.getInt(context.getContentResolver(), Secure.INSTALL_NON_MARKET_APPS);
Logger.logd( "installNonMarketApps: " + installNonMarketApps, verbose, System.out);
return 1== installNonMarketApps;
} catch (SettingNotFoundException e) {
e.printStackTrace();
}
return true;
}
示例5: isAccessibiltiyEnable
import android.provider.Settings.Secure; //导入方法依赖的package包/类
public static boolean isAccessibiltiyEnable(Context context) {
int i = 0;
try {
i = Secure.getInt(context.getContentResolver(), "accessibility_enabled");
} catch (SettingNotFoundException e) {
e.printStackTrace();
}
return i != 0;
}
示例6: showNotification
import android.provider.Settings.Secure; //导入方法依赖的package包/类
@TargetApi(21)
private boolean showNotification() {
return Secure.getInt(this.context.getContentResolver(), LOCK_SCREEN_SHOW_NOTIFICATIONS, 0) != 0;
}
示例7: isUserSetupComplete
import android.provider.Settings.Secure; //导入方法依赖的package包/类
private static boolean isUserSetupComplete(final Activity activity) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
return true;
}
return Secure.getInt(activity.getContentResolver(), "user_setup_complete", 0) != 0;
}
示例8: getInt
import android.provider.Settings.Secure; //导入方法依赖的package包/类
@Override
public int getInt(String name) throws SettingNotFoundException {
return Secure.getInt(mCr, name);
}
示例9: updateDefaultPitch
import android.provider.Settings.Secure; //导入方法依赖的package包/类
/**
* Loads the default pitch adjustment from {@link Secure#TTS_DEFAULT_PITCH}.
* This will take effect during the next call to {@link #trySpeak}.
*/
private void updateDefaultPitch() {
mDefaultPitch = (Secure.getInt(mResolver, Secure.TTS_DEFAULT_PITCH, 100) / 100.0f);
}
示例10: updateDefaultRate
import android.provider.Settings.Secure; //导入方法依赖的package包/类
/**
* Loads the default rate adjustment from {@link Secure#TTS_DEFAULT_RATE}.
* This will take effect during the next call to {@link #trySpeak}.
*/
private void updateDefaultRate() {
mDefaultRate = (Secure.getInt(mResolver, Secure.TTS_DEFAULT_RATE, 100) / 100.0f);
}