mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-01 14:45:08 +00:00
Fix IllegalStateException: Fragment not attached to Activity
BUG: 379873
This commit is contained in:
@@ -99,6 +99,11 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
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) {
|
if (listRefreshCalledThisFrame) {
|
||||||
// This makes sure we don't try to call list.getFirstVisiblePosition()
|
// This makes sure we don't try to call list.getFirstVisiblePosition()
|
||||||
// twice per frame, because the second time the list hasn't been drawn
|
// twice per frame, because the second time the list hasn't been drawn
|
||||||
|
Reference in New Issue
Block a user