我的界面有问题。我在一个活动中初始化界面:map.setFloorInterface(this);
这是方法本身:
public void floorChanged(View view, int floorId) {
map = (MapView) view.inflate(getActivity(), R.layout.map, tView);
map.setFloorInterface(this);
}
我正在尝试重置界面,因为它第二次为空。该界面是从我制作的库中调用的,并在我按下按钮时被触发。
任何人都知道为什么界面第一次工作,但第二次为空?
错误日志:
07-05 16:34:55.273: E/AndroidRuntime(10288): FATAL EXCEPTION: main
07-05 16:34:55.273: E/AndroidRuntime(10288): java.lang.NullPointerException
07-05 16:34:55.273: E/AndroidRuntime(10288): at com.labela.blicks.Map$4.onClick(TiledScrollView.java:108)
07-05 16:34:55.273: E/AndroidRuntime(10288): at android.view.View.performClick(View.java:2538)
07-05 16:34:55.273: E/AndroidRuntime(10288): at android.view.View$PerformClick.run(View.java:9152)
07-05 16:34:55.273: E/AndroidRuntime(10288): at android.os.Handler.handleCallback(Handler.java:587)
07-05 16:34:55.273: E/AndroidRuntime(10288): at android.os.Handler.dispatchMessage(Handler.java:92)
07-05 16:34:55.273: E/AndroidRuntime(10288): at android.os.Looper.loop(Looper.java:130)
07-05 16:34:55.273: E/AndroidRuntime(10288): at android.app.ActivityThread.main(ActivityThread.java:3687)
07-05 16:34:55.273: E/AndroidRuntime(10288): at java.lang.reflect.Method.invokeNative(Native Method)
07-05 16:34:55.273: E/AndroidRuntime(10288): at java.lang.reflect.Method.invoke(Method.java:507)
07-05 16:34:55.273: E/AndroidRuntime(10288): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
07-05 16:34:55.273: E/AndroidRuntime(10288): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
07-05 16:34:55.273: E/AndroidRuntime(10288): at dalvik.system.NativeStart.main(Native Method)
提前谢谢!