Created
May 12, 2015 11:42
-
-
Save KevinOfNeu/73ed3346c96fba2d8a24 to your computer and use it in GitHub Desktop.
cordova platfrom's MainActivity.java file for debugging webview remotely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Bundle; | |
| import android.os.Build; | |
| import org.apache.cordova.*; | |
| import android.webkit.WebView; | |
| public class MainActivity extends CordovaActivity | |
| { | |
| @Override | |
| public void onCreate(Bundle savedInstanceState) | |
| { | |
| super.onCreate(savedInstanceState); | |
| super.init(); | |
| // Set by <content src="index.html" /> in config.xml | |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | |
| WebView webview = new WebView(this); | |
| WebView.setWebContentsDebuggingEnabled(true); | |
| } | |
| loadUrl(launchUrl); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment