Skip to content

Commit

Permalink
fix: Crash when returning to homepage instantly after refreshing node…
Browse files Browse the repository at this point in the history
… list #10
  • Loading branch information
kaaass committed Jul 2, 2022
1 parent 5c06e07 commit 78b8982
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.kaaass.zerotierfix.ui;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -145,9 +146,10 @@ public void onRefresh() {
Thread.sleep(1000);
} catch (InterruptedException ignored) {
}
getActivity().runOnUiThread(() -> {
this.swipeRefreshLayout.setRefreshing(false);
});
Activity activity = getActivity();
if (activity != null) {
activity.runOnUiThread(() -> this.swipeRefreshLayout.setRefreshing(false));
}
}).start();
}

Expand Down

0 comments on commit 78b8982

Please sign in to comment.