使用导航栏并打开片段:错误logcat

时间:2015-02-18 05:52:50

标签: android android-fragments fragment navigationbar

我正在使用改造......数据来自我的服务器...我的应用程序正在崩溃 你能告诉我原因吗

** Logcat **

02-18 11:21:56.467: D/VelocityTracker(8151): tpd read x fail: Bad file number
02-18 11:21:56.467: D/VelocityTracker(8151): tpd read y fail: Bad file number
02-18 11:21:56.582: V/Provider/Setting(8151): from settings cache , name = sound_effects_enabled value = 0
02-18 11:21:56.609: D/AndroidRuntime(8151): Shutting down VM
02-18 11:21:56.610: W/dalvikvm(8151): threadid=1: thread exiting with uncaught exception (group=0x412168a8)
02-18 11:21:56.622: E/AndroidRuntime(8151): FATAL EXCEPTION: main
02-18 11:21:56.622: E/AndroidRuntime(8151): java.lang.NullPointerException
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.widget.ArrayAdapter.getCount(ArrayAdapter.java:330)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.widget.ListView.setAdapter(ListView.java:460)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.app.ListFragment.setListAdapter(ListFragment.java:240)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.app.ListFragment.ensureList(ListFragment.java:424)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.app.ListFragment.onViewCreated(ListFragment.java:203)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:843)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1035)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.app.BackStackRecord.run(BackStackRecord.java:635)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1397)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.app.FragmentManagerImpl$1.run(FragmentManager.java:426)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.os.Handler.handleCallback(Handler.java:615)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.os.Handler.dispatchMessage(Handler.java:92)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.os.Looper.loop(Looper.java:153)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at android.app.ActivityThread.main(ActivityThread.java:5070)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at java.lang.reflect.Method.invokeNative(Native Method)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at java.lang.reflect.Method.invoke(Method.java:511)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
02-18 11:21:56.622: E/AndroidRuntime(8151):     at dalvik.system.NativeStart.main(Native Method)
02-18 11:21:57.776: I/System.out(8151): propertyValue:false
02-18 11:21:57.777: I/System.out(8151): [socket][0] connection www.rainforestelectronics.com/104.219.248.39:80;LocalPort=53948(15000)
02-18 11:21:57.778: I/System.out(8151): [CDS]connect[www.rainforestelectronics.com/104.219.248.39:80] tm:15
02-18 11:21:57.779: D/Posix(8151): [Posix_connect Debug]Process com.example.rain1 :80 
02-18 11:21:58.782: I/System.out(8151): [socket][/192.168.0.102:53948] connected
02-18 11:21:58.783: I/System.out(8151): [CDS]rx timeout:20000

1 个答案:

答案 0 :(得分:0)

检查您的阵列适配器

if(arrayAdapter != null) {
   listView.setAdapter(arrayAdapter);
}