我创建了一个具有 LoginActivity 的应用程序(使用具有恒定凭据的登录表单) TestmapActivity(使用 Google Map Api - 显示地图)
布局:登录(LoginActivity)
myMap (TestmapActivity)
Intent dashboard = new Intent(LoginActivity.this, TestmapActivity.class);
// Close all views before launching Dashboard
dashboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(dashboard);
我用google Api 2.3编译了上面的项目
成功安装,但登录成功时出现错误:应用程序意外停止
11-28 16:44:14.162: E/AndroidRuntime(611): FATAL EXCEPTION: main
11-28 16:44:14.162: E/AndroidRuntime(611): java.lang.NoClassDefFoundError: com.example.androidhive.TestmapActivity
11-28 16:44:14.162: E/AndroidRuntime(611): at com.example.androidhive.LoginActivity$1.onClick(LoginActivity.java:79)
11-28 16:44:14.162: E/AndroidRuntime(611): at android.view.View.performClick(View.java:2485)
11-28 16:44:14.162: E/AndroidRuntime(611): at android.view.View$PerformClick.run(View.java:9080)
11-28 16:44:14.162: E/AndroidRuntime(611): at android.os.Handler.handleCallback(Handler.java:587)
11-28 16:44:14.162: E/AndroidRuntime(611): at android.os.Handler.dispatchMessage(Handler.java:92)
11-28 16:44:14.162: E/AndroidRuntime(611): at android.os.Looper.loop(Looper.java:130)
11-28 16:44:14.162: E/AndroidRuntime(611): at android.app.ActivityThread.main(ActivityThread.java:3683)
11-28 16:44:14.162: E/AndroidRuntime(611): at java.lang.reflect.Method.invokeNative(Native Method)
11-28 16:44:14.162: E/AndroidRuntime(611): at java.lang.reflect.Method.invoke(Method.java:507)
11-28 16:44:14.162: E/AndroidRuntime(611): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-28 16:44:14.162: E/AndroidRuntime(611): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-28 16:44:14.162: E/AndroidRuntime(611): at dalvik.system.NativeStart.main(Native Method)