Fix wrong fragment receiving context menu event
This commit is contained in:
parent
160401ad13
commit
96fe0917e0
|
@ -168,10 +168,9 @@ public abstract class EpisodesListFragment extends Fragment {
|
|||
@Override
|
||||
public boolean onContextItemSelected(@NonNull MenuItem item) {
|
||||
Log.d(TAG, "onContextItemSelected() called with: " + "item = [" + item + "]");
|
||||
if (!getUserVisibleHint()) {
|
||||
return false;
|
||||
}
|
||||
if (!isVisible()) {
|
||||
if (!getUserVisibleHint() || !isVisible() || !isMenuVisible()) {
|
||||
// The method is called on all fragments in a ViewPager, so this needs to be ignored in invisible ones.
|
||||
// Apparently, none of the visibility check method works reliably on its own, so we just use all.
|
||||
return false;
|
||||
}
|
||||
if (item.getItemId() == R.id.share_item) {
|
||||
|
|
Loading…
Reference in New Issue