System cannot be resolved
Settings.Systemがコードに含まれている、またはであるたびにエラーが発生しますnot a field
。どうすればこれを修正できますか?
public class InternetSpeedup extends Activity {
ImageView toggle;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_internet_speedup);
toggle = (ImageView) findViewById(R.id.imageView1);
new CountDownTimer(31000, 1000) {
public void onTick(long millisUntilFinished) {
//toggle.setText("You have "+ millisUntilFinished / 1000 + " seconds left");
}
public void onFinish() {
// read the airplane mode setting
boolean isEnabled = Settings.System.getInt(
getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) == 1;
// toggle airplane mode
Settings.System.putInt(
getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, isEnabled ? 0 : 1);
// Post an intent to reload
Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
intent.putExtra("state", !isEnabled);
sendBroadcast(intent);
}
};
}
}