最赞回答 / lcx66666
a.ViewStub有个特点,它只能被inflate一次,之后会被置空,如果再次使用inflate时,则会报空指针异常,所以要是经常来回切换ViewStub的显示和隐藏,ViewStub就不再适用。b.xml资源文件中必须用android:layout ="@layout/common_text"加载layout资源文件,否则会报加载不到资源的异常而不是单纯的layout="@layout/common_text"你看看是不是以上两种情况
2015-04-09
private int[] icons = { R.drawable.address_book, R.drawable.calendar, R.drawable.camera,
R.drawable.clock, R.drawable.games_control, R.drawable.messenger,R.drawable.ringtone,
R.drawable.settings, R.drawable.speech_balloon, R.drawable.weather, R.drawable.world,
R.drawable.youtube };
R.drawable.clock, R.drawable.games_control, R.drawable.messenger,R.drawable.ringtone,
R.drawable.settings, R.drawable.speech_balloon, R.drawable.weather, R.drawable.world,
R.drawable.youtube };
2015-04-08