Skip to content

Commit

Permalink
Remove unnecessary else
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Jun 28, 2018
1 parent 551b7b4 commit 2d46b26
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,18 @@ public static Scheduler from(Looper looper) {
private static Handler createAsyncHandler(Looper looper) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
return Handler.createAsync(looper);
} else {
try {
//noinspection JavaReflectionMemberAccess
return Handler.class
.getConstructor(Looper.class, Handler.Callback.class, boolean.class)
.newInstance(looper, null, true);
} catch (IllegalAccessException ignored) {
} catch (InstantiationException ignored) {
} catch (NoSuchMethodException ignored) {
} catch (InvocationTargetException ignored) {
}
return new Handler(looper);
}
try {
//noinspection JavaReflectionMemberAccess
return Handler.class
.getConstructor(Looper.class, Handler.Callback.class, boolean.class)
.newInstance(looper, null, true);
} catch (IllegalAccessException ignored) {
} catch (InstantiationException ignored) {
} catch (NoSuchMethodException ignored) {
} catch (InvocationTargetException ignored) {
}
return new Handler(looper);
}

private AndroidSchedulers() {
Expand Down

0 comments on commit 2d46b26

Please sign in to comment.