Android Settings.SettingNotFoundException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Settings.SettingNotFoundException class.

This code example shows how to use the following methods:printStackTrace
sb.append("network mode: " + networkMode + "\n");
            sb.append("HTTP proxy: "
                    + Settings.Secure.getString(resolver, Settings.Secure.HTTP_PROXY) + "\n\n");
        } catch (SettingNotFoundException e) {
            e.printStackTrace();
        } 
 
        sb.append("STACK TRACE FOLLOWS\n\n");
 
        StringWriter stackTrace = new StringWriter();
        error.printStackTrace(new PrintWriter(stackTrace));
 
        sb.append(stackTrace.toString());
 
        return sb.toString();
    } 
 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
sb.append("network mode: " + networkMode + "\n");
            sb.append("HTTP proxy: "
                    + Settings.Secure.getString(resolver, Settings.Secure.HTTP_PROXY) + "\n\n");
        } catch (SettingNotFoundException e) {
            e.printStackTrace();
        } 
 
        sb.append("STACK TRACE FOLLOWS\n\n");
 
        StringWriter stackTrace = new StringWriter();
        error.printStackTrace(new PrintWriter(stackTrace));
 
        sb.append(stackTrace.toString());
 
        return sb.toString();
    } 
 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
            automicBrightness = Settings.System.getInt(activity.getContentResolver(),
                    Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
        } 
        catch (SettingNotFoundException e)
        { 
            e.printStackTrace();
        } 
        Log.d(TAG, "is Auto Brightness ?=" + automicBrightness);
        return automicBrightness;
    } 
     
    /** 
     * Stop auto-brightness. 
     *  
     * @param activity 
     *  
     *  
     */ 
    public static void stopAutoBrightness(Activity activity)
    { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
        try {  
        	//need api 8,but my project is api 7. 
            automicBrightness = Settings.System.getInt(aContentResolver, 
                    Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC; 
        } catch (SettingNotFoundException e) { 
            e.printStackTrace(); 
        }  
        return automicBrightness; 
    }  
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
    public static boolean isAutoRotationEnabled(Context context) {
        int current = 0;
        try { 
            current = Settings.System.getInt(context.getContentResolver(), Settings.System.ACCELEROMETER_ROTATION);
        } catch (SettingNotFoundException e) {
            e.printStackTrace();
        } 
        return current == 1 ? true : false;
    } 
 
    public static void setAutoRotationEnabled(Context context, boolean enabled)
    { 
        Settings.System.putInt(context.getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, enabled ? 1 : 0);
    } 
 
    public static IntentFilter getFilter()
    { 
        return null; 
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
        boolean automicBrightness = false;
        try { 
            automicBrightness = Settings.System.getInt(aContentResolver,
                    Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
        } catch (SettingNotFoundException e) {
            e.printStackTrace();
        } 
        return automicBrightness;
    } 
 
 
/** 
     * È¡µÃÆÁÄ»ÁÁ¶È 
     *  
     * @param activity 
     * @return 
     */ 
    public static int getScreenBrightness(Activity activity) {
        int nowBrightnessValue = 0;
        ContentResolver resolver = activity.getContentResolver();
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
        boolean automicBrightness = false;
        try { 
            automicBrightness = Settings.System.getInt(aContentResolver,
                    Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
        } catch (SettingNotFoundException e) {
            e.printStackTrace();
        } 
        return automicBrightness;
    } 
 
 
/** 
     * ȡ����Ļ���� 
     *  
     * @param activity 
     * @return 
     */ 
    public static int getScreenBrightness(Activity activity) {
        int nowBrightnessValue = 0;
        ContentResolver resolver = activity.getContentResolver();
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
		boolean automicBrightness = false;
		try { 
			automicBrightness = Settings.System.getInt(aContentResolver,
					Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
		} catch (SettingNotFoundException e) {
			e.printStackTrace();
		} 
		return automicBrightness;
	} 
 
	/** 
	 * 获取屏幕的亮度 
	 *  
	 * @param activity 
	 * @return 
	 */ 
	public static int getScreenBrightness(Activity activity) {
		int nowBrightnessValue = 0;
		if (null != activity) {
			ContentResolver resolver = activity.getContentResolver();
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
 
		try { 
			state = Settings.System.getInt(context.getContentResolver(),
					Settings.System.AIRPLANE_MODE_ON);
		} catch (SettingNotFoundException e) {
			e.printStackTrace();
		} 
 
		if (state == 0) {
			Settings.System.putInt(context.getContentResolver(),
					Settings.System.AIRPLANE_MODE_ON, 1);
			Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
			intent.putExtra("state", true);
			context.sendBroadcast(intent);
		} else { 
			Settings.System.putInt(context.getContentResolver(),
					Settings.System.AIRPLANE_MODE_ON, 0);
			Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
			intent.putExtra("state", false);
			context.sendBroadcast(intent);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
	    boolean automicBrightness = false;
	    try { 
	        automicBrightness = Settings.System.getInt(contentResolver,
	                Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
	    } catch (SettingNotFoundException e) {
	        e.printStackTrace();
	    } 
	    return automicBrightness;
	} 
	 
	/** 获取当前屏幕亮度  */ 
	public static int getScreenBrightness(Activity activity) {
	    int nowBrightnessValue = 0;
	    ContentResolver resolver = activity.getContentResolver();
	    try { 
	        nowBrightnessValue = Settings.System.getInt(resolver, Settings.System.SCREEN_BRIGHTNESS);
	    } catch (Exception e) {
	        e.printStackTrace();
	    } 
	    return nowBrightnessValue;
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Android Settings.SettingNotFoundException Methods: