Skip to content

Commit 6290fa7

Browse files
committed
Avoid adding duplicate menu items on resume
1 parent 7a18c5b commit 6290fa7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/itkach/aard2/ArticleFragment.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public void onCreate(Bundle savedInstanceState) {
3737

3838
@Override
3939
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
40+
//Looks like this may be called multiple times with the same menu
41+
//for some reason when activity is restored, so need to clear
42+
//to avoid duplicates
43+
menu.clear();
4044
inflater.inflate(R.menu.article, menu);
4145
miBookmark = menu.findItem(R.id.action_bookmark_article);
4246
}

0 commit comments

Comments
 (0)