Pebble: webview, simplify the code since finals are not required anymore

This commit is contained in:
Daniele Gobbetti 2017-01-01 18:37:42 +01:00
parent eaaa940637
commit d22c78e8f7

View File

@ -46,11 +46,10 @@ public class WebViewSingleton extends Activity {
public static WebView getorInitWebView(Context context, GBDevice device, UUID uuid) { public static WebView getorInitWebView(Context context, GBDevice device, UUID uuid) {
if (context instanceof Activity) { if (context instanceof Activity) {
final MutableContextWrapper _contextWrapper = new MutableContextWrapper(context);
if (contextWrapper != null) { if (contextWrapper != null) {
contextWrapper.setBaseContext(context); contextWrapper.setBaseContext(context);
} else { } else {
contextWrapper = _contextWrapper; contextWrapper = new MutableContextWrapper(context);
} }
} }
//here we are sure that contextWrapper is either null or an activity, hence we run on the main thread //here we are sure that contextWrapper is either null or an activity, hence we run on the main thread