Settings.System.putInt

1. Save variables to the Settings database, and the switch of flight mode, etc. is implemented in this way.
2. First, you need to define a system attribute value
  path: frameworks/base/core/java/android/provider/Settings.java
 public static final String VIVIEN_FASTFOOD= "hungry";
3. Use
  requires import android.provider.Settings;
  Settings.System.getInt(getContentResolver(),settings.System.VIVIEN_FASTFOOD,0) Settings.System.putInt(getContentResolver(),Settings.System. VIVIEN_FASTFOOD,1);

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326049515&siteId=291194637