Skip to content

Instantly share code, notes, and snippets.

@champierre
Created February 9, 2012 08:19
Show Gist options
  • Select an option

  • Save champierre/1778378 to your computer and use it in GitHub Desktop.

Select an option

Save champierre/1778378 to your computer and use it in GitHub Desktop.
Is it possible to create your own WebView(not the one that DroidGap provides) and make PhoneGap work on it on Android?
I have an existing Android project which has my own WebView. I want to extend that WebView so that PhoneGap can be used on it.
What I want to do is similar to:
Cleavage
http://blogs.nitobi.com/jesse/2010/04/20/introducing-iphone-cleavage/
but on Android.
I tried the following code, but PhoneGap did now work and got java.lang.NullPointerException at com.phonegap.DroidGap$1$1.run(DroidGap.java:479)
Any help, advice, hint is appreciated.
===
import android.app.Activity;
import android.os.Bundle;
import com.phonegap.*;
import android.webkit.WebView;
public class MyWebViewActivity extends DroidGap {
private WebView webView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.my_web_view_activity);
webView = (WebView) findViewById(R.id.web_view);
appView = webView;
super.loadUrl("file:///android_asset/www/index.html");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment