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


Java SettingNotFoundException.printStackTrace方法代码示例

本文整理汇总了Java中android.provider.Settings.SettingNotFoundException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java SettingNotFoundException.printStackTrace方法的具体用法?Java SettingNotFoundException.printStackTrace怎么用?Java SettingNotFoundException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.provider.Settings.SettingNotFoundException的用法示例。


在下文中一共展示了SettingNotFoundException.printStackTrace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initBrightnessTouch

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
@TargetApi(android.os.Build.VERSION_CODES.FROYO)
private void initBrightnessTouch() {
    float brightnesstemp = 0.6f;
    // Initialize the layoutParams screen brightness
    try {
        if (AndroidUtil.isFroyoOrLater() &&
                Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
            Settings.System.putInt(getContentResolver(),
                    Settings.System.SCREEN_BRIGHTNESS_MODE,
                    Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
            mRestoreAutoBrightness = android.provider.Settings.System.getInt(getContentResolver(),
                    android.provider.Settings.System.SCREEN_BRIGHTNESS) / 255.0f;
        } else {
            brightnesstemp = android.provider.Settings.System.getInt(getContentResolver(),
                android.provider.Settings.System.SCREEN_BRIGHTNESS) / 255.0f;
        }
    } catch (SettingNotFoundException e) {
        e.printStackTrace();
    }
    WindowManager.LayoutParams lp = getWindow().getAttributes();
    lp.screenBrightness = brightnesstemp;
    getWindow().setAttributes(lp);
    mIsFirstBrightnessGesture = false;
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:25,代码来源:VideoPlayerActivity.java

示例2: backLightStatus

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
public int backLightStatus()
{
    int backLight=0;
    try {
        backLight = Settings.System.getInt(QtApplication.mainActivity().getContentResolver(),Settings.System.SCREEN_BRIGHTNESS);
    } catch (SettingNotFoundException e) {
        e.printStackTrace();
    }
    if((backLight<=BRIGHTNESS_ON) && (backLight>=BRIGHTNESS_DIM))
    {
        return 2;
    }
    else if((backLight>=BRIGHTNESS_OFF) && (backLight<=BRIGHTNESS_DIM))
    {
        return 1;
    }
    else if(backLight==BRIGHTNESS_OFF)
    {
        return 0;
    }
    else
    {
        return -1;
    }

}
 
开发者ID:harmattan,项目名称:uds,代码行数:27,代码来源:QtSystemInfo.java

示例3: isLocationEnabled

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的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

示例4: isLocationEnabled

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的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

示例5: initBrightnessSettings

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
private void initBrightnessSettings() {
conRes = getContentResolver();
  	if(isBrightness) {
      	
      	try {
      		brightnessModePref = Settings.System.getInt(conRes, Settings.System.SCREEN_BRIGHTNESS_MODE);
      		if(brightnessModePref == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
      			Settings.System.putInt(conRes, Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
      		}
      		else {
      			brightnessLevelPref = Settings.System.getInt(conRes, Settings.System.SCREEN_BRIGHTNESS);
      		}
      		Settings.System.putInt(conRes, Settings.System.SCREEN_BRIGHTNESS, 255);
      	}
      	catch(SettingNotFoundException e) {
      		Log.e(TAG, "Cannot access system brightness settings.");
      		e.printStackTrace();
      	}
  	}
  }
 
开发者ID:bjcrawford,项目名称:Mirror-Core,代码行数:21,代码来源:MirrorActivity.java

示例6: initBrightnessTouch

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
private void initBrightnessTouch() {
    float brightnesstemp = 0.01f;
    try {
        brightnesstemp = android.provider.Settings.System.getInt(getContentResolver(),
                android.provider.Settings.System.SCREEN_BRIGHTNESS) / 255.0f;
    } catch (SettingNotFoundException e) {
        e.printStackTrace();
    }
    WindowManager.LayoutParams lp = getWindow().getAttributes();
    lp.screenBrightness = brightnesstemp;
    getWindow().setAttributes(lp);
    mIsFirstBrightnessGesture = false;
}
 
开发者ID:lzmlsfe,项目名称:19porn,代码行数:14,代码来源:PlayerActivity.java

示例7: isAutoBrightness

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
private boolean isAutoBrightness() {
    try {
        return System.getInt(this.mContext.getContentResolver(), "screen_brightness_mode") == 1;
    } catch (SettingNotFoundException e) {
        e.printStackTrace();
        return false;
    }
}
 
开发者ID:HitRoxxx,项目名称:FloatingNew,代码行数:9,代码来源:SystemOverlayMenuService.java

示例8: canSideLoad

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的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

示例9: getScreenBrightness

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
/**
 * 获取当前屏幕亮度,范围0-255
 * 
 * @param context
 * @return 屏幕当前亮度值
 */
public static int getScreenBrightness(Context context) {
	int rightnessValue = 0;
	try {
		rightnessValue = Settings.System.getInt(
				context.getContentResolver(),
				Settings.System.SCREEN_BRIGHTNESS);
	} catch (SettingNotFoundException e) {
		e.printStackTrace();
	}
	return rightnessValue;
}
 
开发者ID:iQuick,项目名称:NewsMe,代码行数:18,代码来源:AndroidUtil.java

示例10: isAutomicBrightness

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
/**
 * 判断是否开启了自动亮度调节
 * 
 * @param context
 * @return
 */
public static boolean isAutomicBrightness(Context context) {
	boolean automicBrightness = false;
	try {
		automicBrightness = Settings.System.getInt(
				context.getContentResolver(),
				Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
	} catch (SettingNotFoundException e) {
		e.printStackTrace();
	}
	return automicBrightness;
}
 
开发者ID:iQuick,项目名称:NewsMe,代码行数:18,代码来源:AndroidUtil.java

示例11: displayBrightness

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
public int displayBrightness ()
{
    int backLight=0;
    try {
        backLight = Settings.System.getInt(QtApplication.mainActivity().getContentResolver(),Settings.System.SCREEN_BRIGHTNESS);
    } catch (SettingNotFoundException e) {
        e.printStackTrace();
    }
    backLight=(backLight*100)/BRIGHTNESS_ON;
    return backLight;
}
 
开发者ID:harmattan,项目名称:uds,代码行数:12,代码来源:QtSystemInfo.java

示例12: getRotationStatus

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
private int getRotationStatus(Context context)  
{  
    int status = 0;  
    try  
    {  
        status = android.provider.Settings.System.getInt(context.getContentResolver(),  
                android.provider.Settings.System.ACCELEROMETER_ROTATION);  
    }  
    catch (SettingNotFoundException e)  
    {  
        // TODO Auto-generated catch block  
        e.printStackTrace();  
    }  
    return status;  
}
 
开发者ID:conseweb,项目名称:cleanmaster,代码行数:16,代码来源:FunActivity.java

示例13: isAccessibiltiyEnable

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的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

示例14: isAutoBrightness

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
public static boolean isAutoBrightness(Activity activity) {
	boolean autoBrightness = false;
	ContentResolver contentResolver = activity.getContentResolver();
	try {
		autoBrightness = Settings.System.getInt(contentResolver,
				Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
	} catch (SettingNotFoundException e) {
		e.printStackTrace();
	}
	return autoBrightness;
}
 
开发者ID:justingboy,项目名称:CouldBooks,代码行数:12,代码来源:SystemBrightManager.java

示例15: getBrightness

import android.provider.Settings.SettingNotFoundException; //导入方法依赖的package包/类
public static int getBrightness(Activity activity) {
	int brightValue = 0; 
	ContentResolver contentResolver = activity.getContentResolver();
	try {
		brightValue = Settings.System.getInt(contentResolver, Settings.System.SCREEN_BRIGHTNESS);
	} catch (SettingNotFoundException e) {
		e.printStackTrace();
	}  
	return brightValue;
}
 
开发者ID:justingboy,项目名称:CouldBooks,代码行数:11,代码来源:SystemBrightManager.java


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