mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-02 07:05:09 +00:00
Fixed crash
This commit is contained in:
@@ -301,7 +301,7 @@ public class DeviceFragment extends Fragment {
|
|||||||
boolean reachable = device.isReachable();
|
boolean reachable = device.isReachable();
|
||||||
|
|
||||||
rootView.findViewById(R.id.pairing_buttons).setVisibility(paired ? View.GONE : View.VISIBLE);
|
rootView.findViewById(R.id.pairing_buttons).setVisibility(paired ? View.GONE : View.VISIBLE);
|
||||||
rootView.findViewById(R.id.unpair_message).setVisibility((paired && !reachable)? View.VISIBLE : View.GONE);
|
rootView.findViewById(R.id.unpair_message).setVisibility((paired && !reachable) ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ArrayList<ListAdapter.Item> items = new ArrayList<>();
|
ArrayList<ListAdapter.Item> items = new ArrayList<>();
|
||||||
@@ -350,14 +350,15 @@ public class DeviceFragment extends Fragment {
|
|||||||
ListAdapter adapter = new ListAdapter(mActivity, items);
|
ListAdapter adapter = new ListAdapter(mActivity, items);
|
||||||
buttonsList.setAdapter(adapter);
|
buttonsList.setAdapter(adapter);
|
||||||
|
|
||||||
|
mActivity.invalidateOptionsMenu();
|
||||||
|
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
//Ignore: The activity was closed while we were trying to update it
|
||||||
} catch (ConcurrentModificationException e) {
|
} catch (ConcurrentModificationException e) {
|
||||||
Log.e("DeviceActivity", "ConcurrentModificationException");
|
Log.e("DeviceActivity", "ConcurrentModificationException");
|
||||||
this.run(); //Try again
|
this.run(); //Try again
|
||||||
}
|
}
|
||||||
|
|
||||||
mActivity.invalidateOptionsMenu();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user