我有一个自定义列表,我的列表被选中并指示我的简单列表...我的简单列表添加按钮,我的按钮单击开始新活动(地图)并缩放到点。 我做了mimplelist但点击按钮没有开始活动和缩放地图......
08-30 03:46:29.401: E/AndroidRuntime(1702): FATAL EXCEPTION: main
08-30 03:46:29.401: E/AndroidRuntime(1702): Process: com.example.ibbmaps, PID: 1702
08-30 03:46:29.401: E/AndroidRuntime(1702): java.lang.NullPointerException
08-30 03:46:29.401: E/AndroidRuntime(1702): at android.content.ComponentName.<init>(ComponentName.java:77)
08-30 03:46:29.401: E/AndroidRuntime(1702): at android.content.Intent.<init>(Intent.java:3813)
08-30 03:46:29.401: E/AndroidRuntime(1702): at com.example.ibbmaps.singleadapterim$1.onClick(singleadapterim.java:119)
08-30 03:46:29.401: E/AndroidRuntime(1702): at android.view.View.performClick(View.java:4438)
08-30 03:46:29.401: E/AndroidRuntime(1702): at android.view.View$PerformClick.run(View.java:18422)
08-30 03:46:29.401: E/AndroidRuntime(1702): at android.os.Handler.handleCallback(Handler.java:733)
08-30 03:46:29.401: E/AndroidRuntime(1702): at android.os.Handler.dispatchMessage(Handler.java:95)
08-30 03:46:29.401: E/AndroidRuntime(1702): at android.os.Looper.loop(Looper.java:136)
08-30 03:46:29.401: E/AndroidRuntime(1702): at android.app.ActivityThread.main(ActivityThread.java:5017)
08-30 03:46:29.401: E/AndroidRuntime(1702): at java.lang.reflect.Method.invokeNative(Native Method)
08-30 03:46:29.401: E/AndroidRuntime(1702): at java.lang.reflect.Method.invoke(Method.java:515)
08-30 03:46:29.401: E/AndroidRuntime(1702): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-30 03:46:29.401: E/AndroidRuntime(1702): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-30 03:46:29.401: E/AndroidRuntime(1702): at dalvik.system.NativeStart.main(Native Method)
然后点击按钮
public void onClick(View v) {
Intent intent = new Intent(context, acilis.class);
intent.putExtra("x",(arac.GETX()));
intent.putExtra("y",(arac.GETY()));
context.startActivity(intent);
我叫功能
Intent i = getIntent();
// Get the results of rank
if( getIntent().getExtras() != null)
{
X = i.getStringExtra("x");
Y = i.getStringExtra("y");
XD = Double.parseDouble(X);
YD = Double.parseDouble(Y);
LatLng den = new LatLng(XD, YD);
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(den, 13));
编辑 解决问题的方法 变化
Intent intent = new Intent(context, acilis.class);
到
Intent intent = new Intent((this class name).this, acilis.class);
感谢。每个人身体