我在Pastie的第 98 行得到了 NullPointerException ,在我的 locate 中得到了等于第 191 行imageLoader.displayImage((String) myArr.get(position).get("image_url"), imageView, options, new SimpleImageLoadingListener()..
。
我所有的网址都存储在ArrayList<HashMap<String, Object>>
完整代码http://pastie.org/7108410#94
错误
03-25 16:39:33.382: E/AndroidRuntime(18178): FATAL EXCEPTION: main
03-25 16:39:33.382: E/AndroidRuntime(18178): java.lang.NullPointerException
03-25 16:39:33.382: E/AndroidRuntime(18178): at com.camitss.phnompenhcafe.ImagePagerActivity$ImagePagerAdapter.instantiateItem(ImagePagerActivity.java:191)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:801)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.support.v4.view.ViewPager.populate(ViewPager.java:930)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.support.v4.view.ViewPager.populate(ViewPager.java:881)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1366)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.View.measure(View.java:15479)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.View.measure(View.java:15479)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.View.measure(View.java:15479)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.View.measure(View.java:15479)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.View.measure(View.java:15479)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4824)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
03-25 16:39:33.382: E/AndroidRuntime(18178): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2359)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.View.measure(View.java:15479)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1966)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1212)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1385)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1105)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4452)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.Choreographer.doFrame(Choreographer.java:525)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.os.Handler.handleCallback(Handler.java:615)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.os.Handler.dispatchMessage(Handler.java:92)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.os.Looper.loop(Looper.java:137)
03-25 16:39:33.382: E/AndroidRuntime(18178): at android.app.ActivityThread.main(ActivityThread.java:4895)
03-25 16:39:33.382: E/AndroidRuntime(18178): at java.lang.reflect.Method.invokeNative(Native Method)
03-25 16:39:33.382: E/AndroidRuntime(18178): at java.lang.reflect.Method.invoke(Method.java:511)
03-25 16:39:33.382: E/AndroidRuntime(18178): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
03-25 16:39:33.382: E/AndroidRuntime(18178): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
03-25 16:39:33.382: E/AndroidRuntime(18178): at dalvik.system.NativeStart.main(Native Method)