こんにちはみんな私は2つのクラスを作成しました。1つはmapView用、もう1つは位置設定用です。alertDialogボックスを使用して、ユーザーがGPSを有効にするか、インテントを使用して地図に直接移動するかを選択できるようにしますが、エラーが発生します。誰でも助けることができます???
これがダイアログコードです
public void onClick(View arg0) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
context);
// set title
alertDialogBuilder.setTitle("Your Title");
// set dialog message
alertDialogBuilder
.setMessage("Click yes TO ENABLE GPS")
.setCancelable(false)
.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
// if this button is clicked, close
// current activity
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivityForResult(intent, 1);
}
})
.setNegativeButton("No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
// if this button is clicked, just close
// the dialog box and do nothing
//dialog.cancel();
Intent intent = new Intent(MainActivity.this, AndroidGoogleMapsActivity.class);
context.startActivity(intent);
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
});
これが私が得たエラーです
09-19 08:28:58.996: W/dalvikvm(440): Unable to resolve superclass of Lcom/mkyong/android/AndroidGoogleMapsActivity; (16)
09-19 08:28:58.996: W/dalvikvm(440): Link of class 'Lcom/mkyong/android/AndroidGoogleMapsActivity;' failed
09-19 08:28:59.004: E/dalvikvm(440): Could not find class 'com.mkyong.android.AndroidGoogleMapsActivity', referenced from method com.mkyong.android.MainActivity$1$2.onClick
09-19 08:28:59.004: W/dalvikvm(440): VFY: unable to resolve const-class 19 (Lcom/mkyong/android/AndroidGoogleMapsActivity;) in Lcom/mkyong/android/MainActivity$1$2;
09-19 08:28:59.004: D/dalvikvm(440): VFY: replacing opcode 0x1c at 0x0008
09-19 08:28:59.014: D/dalvikvm(440): VFY: dead code 0x000a-0018 in Lcom/mkyong/android/MainActivity$1$2;.onClick (Landroid/content/DialogInterface;I)V
09-19 08:29:16.164: D/AndroidRuntime(440): Shutting down VM
09-19 08:29:16.174: W/dalvikvm(440): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
09-19 08:29:16.254: E/AndroidRuntime(440): FATAL EXCEPTION: main
09-19 08:29:16.254: E/AndroidRuntime(440): java.lang.NoClassDefFoundError: com.mkyong.android.AndroidGoogleMapsActivity
09-19 08:29:16.254: E/AndroidRuntime(440): at com.mkyong.android.MainActivity$1$2.onClick(MainActivity.java:61)
09-19 08:29:16.254: E/AndroidRuntime(440): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)
09-19 08:29:16.254: E/AndroidRuntime(440): at android.os.Handler.dispatchMessage(Handler.java:99)
09-19 08:29:16.254: E/AndroidRuntime(440): at android.os.Looper.loop(Looper.java:123)
09-19 08:29:16.254: E/AndroidRuntime(440): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-19 08:29:16.254: E/AndroidRuntime(440): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 08:29:16.254: E/AndroidRuntime(440): at java.lang.reflect.Method.invoke(Method.java:521)
09-19 08:29:16.254: E/AndroidRuntime(440): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-19 08:29:16.254: E/AndroidRuntime(440): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-19 08:29:16.254: E/AndroidRuntime(440): at dalvik.system.NativeStart.main(Native Method)
09-19 08:29:18.725: I/Process(440): Sending signal. PID: 440 SIG: 9
修正方法がわかりません