我正在尝试在我的项目中使用Volley,我曾经从PHP中获取JSON数组编码并将其改编为.我遵循了此页面的教程:https://www.androidhive.info/2014/07/android-custom-listview-with-image-and-text-using-volley/JsonArrayRequest()ListView
我的应用程序崩溃了,下面是错误。
2019-03-18 15:34:51.706 14999-14999/com.example.smartparkingapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.smartparkingapp, PID: 14999
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.app.Activity.getSystemService(java.lang.String)' on a null object reference
at com.example.smartparkingapp.adapter.CarListAdapter.getView(CarListAdapter.java:48)
at android.widget.AbsListView.obtainView(AbsListView.java:3180)
at android.widget.ListView.makeAndAddView(ListView.java:2197)
at android.widget.ListView.fillDown(ListView.java:824)
at android.widget.ListView.fillFromTop(ListView.java:885)
at android.widget.ListView.layoutChildren(ListView.java:1924)
at android.widget.AbsListView.onLayout(AbsListView.java:2952)
at android.view.View.layout(View.java:21054)
at android.view.ViewGroup.layout(ViewGroup.java:6440)
at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1915)
at android.view.View.layout(View.java:21054)
at android.view.ViewGroup.layout(ViewGroup.java:6440)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
at android.view.View.layout(View.java:21054)
at android.view.ViewGroup.layout(ViewGroup.java:6440)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
杨魅力
相关分类