Skip to content

Instantly share code, notes, and snippets.

@jansenfelipe
Created March 17, 2014 18:36
Show Gist options
  • Save jansenfelipe/9605499 to your computer and use it in GitHub Desktop.
Save jansenfelipe/9605499 to your computer and use it in GitHub Desktop.
public class MainActivity extends Activity {
private static final String LUNCH_COUNT = "lunch_count";
private int lunchCount;
private SharedPreferences sharedPreferences;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
lunchCount = sharedPreferences.getInt(LUNCH_COUNT, 0) + 1;
sharedPreferences.edit().putInt(LUNCH_COUNT, lunchCount).commit();
new AppRate(this)
.setMinDaysUntilPrompt(0)
.setMinLaunchesUntilPrompt(3)
.setShowIfAppHasCrashed(false)
.init();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment