更改标签时Android未捕获的异常

时间:2014-01-02 17:51:42

标签: android android-fragmentactivity android-tabs

我的tab-layout-app有问题,解释起来有点复杂。

我有3个标签 - 当我点击tab1或tab2 everthing工作正常 - 但是当我点击tab3然后在tab1或tab2上时,应用程序崩溃并出现以下错误:

W/dalvikvm(3719): threadid=1: thread exiting with uncaught exception (group=0x40e2c438)

我不知道它是否相关,但在发生崩溃之后发生错误:

E/dalvikvm(3719): GC_FOR_ALLOC freed 600K, 28% free 10127K/13955K, paused 17ms+14ms, total 63ms

我怎样才能找出问题究竟是什么?

这是TabsPagerAdapter:

public class TabsPagerAdapter extends FragmentPagerAdapter {

public TabsPagerAdapter(FragmentManager fm) {
    super(fm);
}

@Override
public Fragment getItem(int index) {

    switch (index) {
    case 0:
        // Map fragment activity
        return new MapFragment();
    case 1:
        // List fragment activity
        return new ListFragment();
    case 2:
        // Settings fragment activity
        return new SettingsFragment();
    }

    return null;
}

@Override
public int getCount() {
    // get item count - equal to number of tabs
    return 3;
}
 }

这里是Fragment类(Tab3):

public class SettingsFragment extends Fragment {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.fragment_settings, container, false);
    return rootView;        

}
}

这里是整个错误日志: 01-02 19:47:07.409:E / Trace(7227):错误打开跟踪文件:没有这样的文件或目录(2) 01-02 19:47:07.439:W / dalvikvm(7227):拒绝重启开机DEX'/system/framework/hwframework.jar' 01-02 19:47:07.689:W / System.err(7227):无效的int:“” 01-02 19:47:07.699:W / dalvikvm(7227):拒绝重启开机DEX'/system/framework/hwframework.jar' 01-02 19:47:07.979:E / GooglePlayServicesUtil(7227):找不到Google Play服务资源。检查项目配置以确保包含资源。 01-02 19:47:08.359:I / Adreno200-EGL(7227):: EGL 1.4 QUALCOMM build:AU_LINUX_ANDROID_JB_REL_2.0.3.04.01.01.21.010_msm8625_JB_REL_2.0.3_Merge_release_AU(Merge) 01-02 19:47:08.359:I / Adreno200-EGL(7227):建造日期:10/26/12周五 01-02 19:47:08.359:I / Adreno200-EGL(7227):本地分行: 01-02 19:47:08.359:I / Adreno200-EGL(7227):远程分支:quic / jb_rel_2.0.3 01-02 19:47:08.359:I / Adreno200-EGL(7227):本地补丁:无 01-02 19:47:08.359:I / Adreno200-EGL(7227):重建分支:AU_LINUX_ANDROID_JB_REL_2.0.3.04.01.01.21.010 + NOTHING 01-02 19:47:08.749:E / dalvikvm(7227):GC_CONCURRENT释放3635K,32%免费9534K / 13955K,暂停14ms + 7ms,总计143ms 01-02 19:47:08.819:E / dalvikvm(7227):GC_FOR_ALLOC释放153K,33%免费9470K / 13955K,暂停13ms + 13ms,总计47ms 01-02 19:47:08.979:E / dalvikvm(7227):GC_CONCURRENT释放733K,31%免费10173K / 14663K,暂停3ms + 13ms,总计46ms 01-02 19:47:09.069:E / dalvikvm(7227):GC_FOR_ALLOC释放314K,32%免费9977K / 14663K,暂停4ms + 6ms,总计57ms 01-02 19:47:09.199:E / dalvikvm(7227):GC_FOR_ALLOC释放575K,30%免费10357K / 14663K,暂停4ms + 13ms,总计43ms 01-02 19:47:09.289:E / dalvikvm(7227):GC_CONCURRENT释放1141K,32%自由11460K / 16839K,暂停12ms + 13ms,总计62ms 01-02 19:47:09.359:E / dalvikvm(7227):GC_FOR_ALLOC释放1274K,37%免费10642K / 16839K,暂停13ms + 3ms,总计52ms 01-02 19:47:09.449:E / dalvikvm(7227):GC_FOR_ALLOC释放1050K,37%免费10629K / 16839K,暂停3ms + 3ms,总计55ms 01-02 19:47:09.639:E / dalvikvm(7227):GC_CONCURRENT释放1323K,38%免费10441K / 16839K,暂停13ms + 13ms,总计63ms 01-02 19:47:09.759:E / dalvikvm(7227):GC_FOR_ALLOC释放1048K,38%免费10442K / 16839K,暂停5ms + 2ms,总计38ms 01-02 19:47:09.849:E / dalvikvm(7227):GC_CONCURRENT释放1067K,38%免费10583K / 16839K,暂停13ms + 14ms,总计53ms 01-02 19:47:09.949:E / dalvikvm(7227):GC_CONCURRENT释放1099K,37%免费10641K / 16839K,暂停12ms + 14ms,总计63ms 01-02 19:47:10.059:E / dalvikvm(7227):GC_CONCURRENT释放1124K,37%免费10681K / 16839K,暂停13ms + 15ms,总计75ms 01-02 19:47:10.199:E / dalvikvm(7227):GC_CONCURRENT释放1219K,37%自由10740K / 16839K,暂停13ms + 15ms,总计88ms 01-02 19:47:10.659:E / dalvikvm(7227):GC_CONCURRENT释放740K,34%自由11125K / 16839K,暂停13ms + 18ms,总计87ms 01-02 19:47:11.139:E / dalvikvm(7227):GC_CONCURRENT释放895K,33%自由11361K / 16839K,暂停12ms + 16ms,总计73ms 01-02 19:47:11.499:E / dalvikvm(7227):GC_CONCURRENT释放1198K,34%释放11262K / 16839K,暂停14ms + 16ms,总计77ms 01-02 19:47:11.849:E / dalvikvm(7227):GC_CONCURRENT释放810K,32%自由11587K / 16839K,暂停13ms + 20ms,总计99ms 01-02 19:47:17.409:W / dalvikvm(7227):threadid = 1:线程退出未捕获异常(组= 0x40e2c438)

提前致谢!

0 个答案:

没有答案