当前位置: 首页>>代码示例>>Java>>正文


Java Secure.getInt方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:firebirdberlin,项目名称:nightdream,代码行数:18,代码来源:LocationService.java

示例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();
    }
}
 
开发者ID:firebirdberlin,项目名称:tinytimetracker,代码行数:20,代码来源:TinyTimeTracker.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:13,代码来源:aa.java

示例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;
}
 
开发者ID:theaetetus,项目名称:AndroidApkMaker,代码行数:11,代码来源:InstallActivity.java

示例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;
}
 
开发者ID:bunnyblue,项目名称:ApkAutoInstaller,代码行数:10,代码来源:SettingsUtil.java

示例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;
}
 
开发者ID:bunnyblue,项目名称:NoticeDog,代码行数:5,代码来源:ShadeViewManager.java

示例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;
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:7,代码来源:SettingsFragment.java

示例8: getInt

import android.provider.Settings.Secure; //导入方法依赖的package包/类
@Override
public int getInt(String name) throws SettingNotFoundException {
    return Secure.getInt(mCr, name);
}
 
开发者ID:pushbit,项目名称:sprockets-android,代码行数:5,代码来源:SettingsSecure.java

示例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);
}
 
开发者ID:google,项目名称:talkback,代码行数:8,代码来源:FailoverTextToSpeech.java

示例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);
}
 
开发者ID:google,项目名称:talkback,代码行数:8,代码来源:FailoverTextToSpeech.java


注:本文中的android.provider.Settings.Secure.getInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。