OSDN Git Service

Fix Trash icon/action bug
authorBILLyTheLiTTle <littleprog@gmail.com>
Sat, 21 Sep 2013 11:11:15 +0000 (14:11 +0300)
committerSteve Kondik <shade@chemlab.org>
Tue, 25 Feb 2014 09:37:11 +0000 (10:37 +0100)
Change-Id: I401ce0d368bfdf27dc3a6f941695fdedda77811d

Superuser/src/com/koushikdutta/superuser/PolicyFragmentInternal.java

index 832c53c..84fdd8e 100644 (file)
@@ -178,6 +178,14 @@ public class PolicyFragmentInternal extends ListContentFragmentInternal {
 
     @Override
     public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ /* When you are in LogFragmentInternal screen and you rotate the device
+         * you are directed to the first screen (PolicyFragment).
+         * Then you will notice that the trash menu icon still exists.
+         * This is a bug because LogFragmentInternal's menu is loaded.
+         * So, clear any previously loaded menu before load this one.
+         */
+        menu.clear();
+
         super.onCreateOptionsMenu(menu, inflater);
         MenuInflater mi = new MenuInflater(getActivity());
         mi.inflate(R.menu.main, menu);