How can i start a Fragment
in the AboutAndHelpActivity
instead of the Activity
itself or how can i put the Fragment
in startActivity()
?
//if it is the first start of the app, open HelpFragment once.
Boolean isFirstRun = getSharedPreferences("PREFERENCE", MODE_PRIVATE)
.getBoolean("isFirstRun", true);
if (isFirstRun) {
startActivity(new Intent(MainActivity.this, AboutAndHelpActivity.class));
Toast.makeText(MainActivity.this, "First Run", Toast.LENGTH_LONG)
.show();
}
getSharedPreferences("PREFERENCE", MODE_PRIVATE).edit()
.putBoolean("isFirstRun", false).commit();