2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 06:05:12 +00:00

Fix IllegalStateException: Fragment not attached to Activity

BUG: 379873
This commit is contained in:
Albert Vaca
2017-05-16 21:01:34 +02:00
parent 9a5b03c423
commit 2d35b04713

View File

@@ -99,6 +99,11 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
@Override
public void run() {
if (!isAdded()) {
//Fragment is not attached to an activity. We will crash if we try to do anything here.
return;
}
if (listRefreshCalledThisFrame) {
// This makes sure we don't try to call list.getFirstVisiblePosition()
// twice per frame, because the second time the list hasn't been drawn