summaryrefslogtreecommitdiff
path: root/android/sdremote/src/org/libreoffice/impressremote/fragment
diff options
context:
space:
mode:
authorArtur Dryomov <artur.dryomov@gmail.com>2013-07-21 02:11:37 +0300
committerMichael Meeks <michael.meeks@suse.com>2013-07-25 18:01:58 +0100
commit173638b9a4c1d039aeae350765d7fbf8330d91e1 (patch)
tree9e1afb98d9fde7ee1efda29c3f5bdd007509f742 /android/sdremote/src/org/libreoffice/impressremote/fragment
parent15081f45820a858f84c96189bbf53f8d3ea72f64 (diff)
Change ComputersActivity to use swipe tabs.
Such method even remembers a current tab on orientation changes. Change-Id: Iad14af060b41a4b8d225e83af450cdff0a6e78e0
Diffstat (limited to 'android/sdremote/src/org/libreoffice/impressremote/fragment')
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
index 18491d6cc73e..fffd1cfb5566 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
@@ -97,10 +97,6 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
}
private void loadComputers() {
- if (!isAdded()) {
- return;
- }
-
if (!isServiceBound()) {
return;
}
@@ -196,6 +192,8 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
super.onResume();
registerIntentsReceiver();
+
+ loadComputers();
}
private void registerIntentsReceiver() {
@@ -277,6 +275,12 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
@Override
public boolean onContextItemSelected(android.view.MenuItem aMenuItem) {
+ if (!getUserVisibleHint()) {
+ // Wrong context menu could be dispatched.
+ // Android’s issue #20065.
+ return false;
+ }
+
int aComputerPosition = getListItemPosition(aMenuItem);
Server aComputer = getComputersAdapter().getItem(aComputerPosition);