blob: 2dd2b1dfdabaf9ba7b3eb0b22da852c59604d111 [file] [log] [blame]
package test.pkg;
import android.app.Activity;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
@SuppressWarnings("UnusedDeclaration")
public class CommitToApply extends Activity {
public void commitWarning1() {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = preferences.edit();
<warning descr="Consider using `apply()` instead; `commit` writes its data to persistent storage immediately, whereas `apply` will handle it in the background">editor.com<caret>mit()</warning>;
}
}