use of ru.playsoftware.j2meloader.info.AboutDialogFragment in project J2ME-Loader by nikita36078.
the class AppsListFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
FragmentActivity activity = requireActivity();
int itemId = item.getItemId();
if (itemId == R.id.action_about) {
AboutDialogFragment aboutDialogFragment = new AboutDialogFragment();
aboutDialogFragment.show(getChildFragmentManager(), "about");
} else if (itemId == R.id.action_profiles) {
Intent intentProfiles = new Intent(activity, ProfilesActivity.class);
startActivity(intentProfiles);
} else if (item.getItemId() == R.id.action_settings) {
startActivity(new Intent(activity, SettingsActivity.class));
return true;
} else if (itemId == R.id.action_help) {
HelpDialogFragment helpDialogFragment = new HelpDialogFragment();
helpDialogFragment.show(getChildFragmentManager(), "help");
} else if (itemId == R.id.action_donate) {
Intent donationsIntent = new Intent(activity, DonationsActivity.class);
startActivity(donationsIntent);
} else if (itemId == R.id.action_save_log) {
try {
LogUtils.writeLog();
Toast.makeText(activity, R.string.log_saved, Toast.LENGTH_SHORT).show();
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(activity, R.string.error, Toast.LENGTH_SHORT).show();
}
} else if (itemId == R.id.action_exit_app) {
activity.finish();
} else if (itemId == R.id.action_sort) {
showSortDialog();
}
return false;
}
Aggregations