From 597c1b7bf59b453903df6487d5afc59110539bcd Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 7 Nov 2015 19:36:51 +0100 Subject: [PATCH] Add finish button --- .../src/net/osmand/plus/activities/HelpActivity.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java index 7125aaabad..3895d77d32 100644 --- a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java @@ -29,6 +29,7 @@ import android.support.v4.app.FragmentTransaction; import android.support.v7.widget.Toolbar; import android.util.TypedValue; import android.view.LayoutInflater; +import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; @@ -60,11 +61,22 @@ public class HelpActivity extends OsmandActionBarActivity { ft.add(DIALOG, newFragment).commit(); } setTitle(R.string.shared_string_help); + setupHomeButton(); // if (getSupportFragmentManager().findFragmentByTag(DIALOG) == null) { // new HelpScreenDialogFragment().show(getSupportFragmentManager(), DIALOG); // } } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + this.finish(); + return true; + } + return super.onOptionsItemSelected(item); + } + public static class HelpScreenDialogFragment extends Fragment implements ExpandableListView.OnChildClickListener { private static final Log LOG = PlatformUtil.getLog(HelpScreenDialogFragment.class);