Skip to content

Instantly share code, notes, and snippets.

@KevinOfNeu
Created May 12, 2015 11:42
Show Gist options
  • Select an option

  • Save KevinOfNeu/73ed3346c96fba2d8a24 to your computer and use it in GitHub Desktop.

Select an option

Save KevinOfNeu/73ed3346c96fba2d8a24 to your computer and use it in GitHub Desktop.
cordova platfrom's MainActivity.java file for debugging webview remotely.
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