我在Android上使用Cordova 5.1.1实现了一些问题.我正在尝试在我的应用程序中嵌入CordovaWebView.我已按照其官方网站中描述的所有说明操作,但我不断收到错误" org.apache.cordova.CordovaWebView无法转换为android.view.View ".我已经搜索了很多帮助,但我找不到任何可以帮助我的东西.这是我的代码:
活动:
public class CordovaTestActivity extends Activity implements CordovaInterface {
protected CordovaPlugin activityResultCallback = null;
protected boolean activityResultKeepRunning;
protected boolean keepRunning = true;
private final ExecutorService threadPool = Executors.newCachedThreadPool();
CordovaWebView cwv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cordova_test);
cwv = (CordovaWebView) findViewById(R.id.tutorialView);
Config.init(this);
cwv.loadUrl(Config.getStartUrl());
}
@Override
public Activity getActivity() {
return this;
}
@Override
public ExecutorService getThreadPool() {
return threadPool;
}
@Override
public Object onMessage(String arg0, Object arg1) {
return null;
}
@Override
public …Run Code Online (Sandbox Code Playgroud)