Attempt to invoke virtual method android.webkit.WebView.setWebViewClient
Opened this issue · 0 comments
cinder92 commented
Hello, thanks for your library, im migrating to react-native, but having some issues, i want to know if you can help me.
The error is this.
Attempt to invoke virtual method 'void android.webkit.WebView.setWebViewClient(android.webkit.WebViewClient)' on a null object reference
initialize
Icarus.java:130
render
Icarus.java:208
public class KnifeViewManager extends SimpleViewManager<WebView> {
public static final String REACT_CLASS = "RCTKnifeView";
protected WebView webView;
@Override public String getName() {
return REACT_CLASS;
}
@Override public WebView createViewInstance(ThemedReactContext context){
//return new WebView(context);
TextViewToolbar toolbar = new TextViewToolbar();
Options options = new Options();
options.setPlaceholder("Write Here ...");
options.addAllowedAttributes("img", Arrays.asList("data-type", "data-id", "class", "src", "alt", "width", "height", "data-non-image"));
options.addAllowedAttributes("iframe", Arrays.asList("data-type", "data-id", "class", "src", "width", "height"));
options.addAllowedAttributes("a", Arrays.asList("data-type", "data-id", "class", "href", "target", "title"));
Icarus icarus = new Icarus(toolbar, options, webView);
//TextViewButton boldButton = new TextViewButton();
//boldButton.setName(Button.NAME_BOLD);
//toolbar.addButton(boldButton);
//icarus.insertHtml("<img src='http://lorempixel.com/200/200' />");
icarus.render();
return webView;
}
}
any idea?