Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ protected static Activity getActivity() {
return wr_activity.get();
}

protected static boolean hasActivity() {
return (wr_activity != null);
}

public static void openSplashScreen(Activity activity) {
openSplashScreen(activity, false);
}
Expand All @@ -49,7 +53,7 @@ public static void openSplashScreen(final Activity activity, final boolean isFul
activity.runOnUiThread(new Runnable() {
public void run() {

if(!getActivity().isFinishing()) {
if(hasActivity() && !getActivity().isFinishing()) {
Context context = getActivity();
imageView = new ImageView(context);

Expand Down Expand Up @@ -78,9 +82,10 @@ public void run() {
}

public static void removeSplashScreen(Activity activity, final int animationType,final int duration) {
if (activity == null) {
if (hasActivity()) {
activity = getActivity();
if(activity == null) return;
} else {
return;
}
activity.runOnUiThread(new Runnable() {
public void run() {
Expand Down