Rookie after 2 hours of adjustment, it is important to find the problem:
The code does not raise errors, the program always displays errors when running, the error is:
11-24 15:22:16.587:e/androidruntime (19903): FATAL exception:main
11-24 15:22:16.587:e/androidruntime (19903): java.lang.RuntimeException:Unable to start activity componentinfo{ Com.example.shikechannel/com.example.shikechannel.channelactivity}: Android.view.InflateException:Binary XML file Line #40: Error inflating class Com.handmark.pulltorefresh.library.PullToRefreshListView
If you look at the error, you know that there should be a layout problem, and I have a layout that says:
<include
Android:id= "@+id/chaneltheme"
layout= "@layout/channel_theme"/>
Without putting this include in a layout, the result is a bit of a conflict with the following,
The right way is:
<relativelayout
Android:layout_width= "Fill_parent"
android:layout_height= "50DP"
Android:background= "#ffffff"
>
<include
Android:id= "@+id/chaneltheme"
layout= "@layout/channel_theme"/>
</RelativeLayout>
In this way, the effect is good, will not report errors,
It took the rookie two hours to get to the truth:
1, must learn to see Logcat direction error, do not waste too much time in the right place.
2, Android layout also need to learn well.
Android code no error, but run error