Cordova ile özel bir WebView oluşturmak istiyorum. Bunu yapmak için setWebChromeClient ve setWebViewClient yöntemlerini geçersiz kılmak istiyorum. Ancak bunun için bir SystemWebViewEngine gerektiren bir SystemWebViewClient olması gerekiyor, bu noktada bulamıyorum. benim ana faaliyet İşte Bina Özel Web Görünümü Cordova 5.0 ile Android içinde
public class MyActivity extends CordovaActivity implements CordovaInterface {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int threadSize = getResources().getInteger(R.integer.WIPThreadPoolSize);
// Initiate Thread pool
threadPool = new ThreadPoolExecutor(threadSize, threadSize, 10, TimeUnit.SECONDS, this.priorityQueue);
initApplicationInformationManager();
// initialize global variables
GlobalApplicationVariables.initValues(this);
isActivityReady = false;
isActivityReady = false;
setContentView(R.layout.main_layout);
super.init();
}
protected CordovaWebView makeWebView() {
SystemWebView webView = (SystemWebView) findViewById(R.id.customWebView);
SystemWebViewEngine engine = new SystemWebViewEngine(webView);
return new CordovaWebViewImpl(engine);
}
protected void createViews() {
appView.getView().requestFocusFromTouch();
}
}
Ve özel webview:
@SuppressLint("SetJavaScriptEnabled")
public class CustomWebView extends SystemWebView {
private DebugServiceClient dbgClient;
public CustomWebView(Context context) {
super(context);
this.configureView(context);
}
public CustomWebView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.configureView(context);
}
/**
* Configure the web view.
*
* @param context
* Context web view is running in.
*/
private void configureView(Context context) {
//Make the WebView visible and hide its scroll bars
setVisibility(View.VISIBLE);
setVerticalScrollBarEnabled(false);
setHorizontalScrollBarEnabled(false);
setOverScrollMode(OVER_SCROLL_NEVER);
WebSettings webSettings = getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setSupportZoom(false);
webSettings.setAppCacheEnabled(false);
webSettings.setDomStorageEnabled(true);
final MyActivity myActivity = (MyActivity) context;
setWebChromeClient(new SystemWebChromeClient(new SystemWebViewEngine(this)) {
public void onShowCustomView(View view, CustomViewCallback callback) {
/*Custom code*/
}
public void onHideCustomView() {
/*Custom code*/
}
});
setWebViewClient(new SystemWebViewClient(new SystemWebViewEngine(this)) {
public boolean shouldOverrideUrlLoading(WebView webview, String url) {
/*Custom code*/
}
public void onReceivedError(WebView view, int errorCod, String description, String failingUrl) {
Log.e("Webview Error", errorCod + " - " + description + failingUrl);
}
});
}
}
yöntemleri üzerine, bu yüzden sadece anında bir yaratılmış ama bu bazı üretir böylece gerçekten bir motor alınamıyor hatalar. Ayrıca Cordova Plugin Manager'a erişemiyorum ve sonuç olarak web görünümüne eklenti ekleyemiyorum. Bunu yapmanın en iyi yolu hangisi?
MainActivity bu overrided yöntemle overrided SystemWebViewClient değilim? – JSON