+ /**
+ * We want the help screen to be shown automatically the first time a new version of the app is
+ * run. The easiest way to do this is to check android:versionCode from the manifest, and compare
+ * it to a value stored as a preference.
+ */
+ private void showHelpOnFirstLaunch() {
+ try {
+ PackageInfo info = getPackageManager().getPackageInfo(PACKAGE_NAME, 0);
+ int currentVersion = info.versionCode;
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
+ int lastVersion = prefs.getInt(PreferencesActivity.KEY_HELP_VERSION_SHOWN, 0);
+ if (currentVersion > lastVersion) {
+ prefs.edit().putInt(PreferencesActivity.KEY_HELP_VERSION_SHOWN, currentVersion).commit();
+ Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.setClassName(this, HelpActivity.class.getName());
+ startActivity(intent);
+ }
+ } catch (PackageManager.NameNotFoundException e) {
+
+ }
+ }
+