我正在做我的第一个 android 学习教程,但遇到了标题描述的这个错误。这是我试图在 Eclipse、java 上做的一个应用程序,这是我的代码 ..(代码是由项目自动生成的)
package com.HelloWorkLight;
import android.R;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import org.apache.cordova.CordovaActivity;``
import com.worklight.androidgap.api.WL;
import com.worklight.androidgap.api.WLInitWebFrameworkResult;
import com.worklight.androidgap.api.WLInitWebFrameworkListener;
public class HelloWorkLight extends CordovaActivity implements WLInitWebFrameworkListener {
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
WL.createInstance(this);
WL.getInstance().showSplashScreen(this);
WL.getInstance().initializeWebFramework(getApplicationContext(), this);
}
/**
* The IBM MobileFirst Platform calls this method after its initialization is complete and web resources are ready to be used.
*/
public void onInitWebFrameworkComplete(WLInitWebFrameworkResult result){
if (result.getStatusCode() == WLInitWebFrameworkResult.SUCCESS) {
super.loadUrl(WL.getInstance().getMainHtmlFilePath());
} else {
handleWebFrameworkInitFailure(result);
}
}
private void handleWebFrameworkInitFailure(WLInitWebFrameworkResult result){
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setNegativeButton(R.string.close, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which){
finish();
}
});
alertDialogBuilder.setTitle(R.string.error);
alertDialogBuilder.setMessage(result.getMessage());
alertDialogBuilder.setCancelable(false).create().show();
}
}
先感谢您 :)