mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
Clean up code and consolidate bindBrowser with init.
This commit is contained in:
parent
aa6e4185de
commit
336a58ca5a
@ -263,8 +263,9 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
// Enable built-in geolocation
|
// Enable built-in geolocation
|
||||||
WebViewReflect.setGeolocationEnabled(settings, true);
|
WebViewReflect.setGeolocationEnabled(settings, true);
|
||||||
|
|
||||||
// Bind PhoneGap objects to JavaScript
|
// Create callback server and plugin manager
|
||||||
this.bindBrowser(this.appView);
|
this.callbackServer = new CallbackServer();
|
||||||
|
this.pluginManager = new PluginManager(this.appView, this);
|
||||||
|
|
||||||
// Add web view but make it invisible while loading URL
|
// Add web view but make it invisible while loading URL
|
||||||
this.appView.setVisibility(View.INVISIBLE);
|
this.appView.setVisibility(View.INVISIBLE);
|
||||||
@ -287,17 +288,6 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
appView.setWebViewClient(client);
|
appView.setWebViewClient(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Bind PhoneGap objects to JavaScript.
|
|
||||||
*
|
|
||||||
* @param appView
|
|
||||||
*/
|
|
||||||
private void bindBrowser(WebView appView) {
|
|
||||||
this.callbackServer = new CallbackServer();
|
|
||||||
this.pluginManager = new PluginManager(appView, this);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Look at activity parameters and process them.
|
* Look at activity parameters and process them.
|
||||||
* This must be called from the main UI thread.
|
* This must be called from the main UI thread.
|
||||||
|
Loading…
Reference in New Issue
Block a user