内存不足; SQLite数据库崩溃了

时间:2016-03-12 04:22:59

标签: android sqlite out-of-memory android-sqlite

当我打开片段,并开始填充AridAdapter时,该适配器从SQLite数据库中获取数据。
但是出了点问题,我得到out of memory例外,应用就停止了。

一些代码:

Database database;

String[] Description;

String[] Title;
int[] Minute;
 int[] Hour;
int[] Day;
int[] Month;
int[] Year;
 int mId;
public Integer[] mThumbIds;

private Context mContext;
private int ACTIVE;


public void DataPrepear(int ACTIVE){
    database = new Database(mContext);
    mId = database.getLastIdOD();
    database.close();
    for(int i=1;i==mId;i++){
        database = new Database(mContext);
    OneDayTD notification = database.getOneDay(i);
        if(notification.getActive()==ACTIVE) {
            Title[i - 1] = notification.getTitle();
            Description[i-1] = notification.getContent();
            Minute[i-1]= Integer.valueOf(getMinuteInt(notification.getDateAndTime()));
            Hour[i-1]= Integer.valueOf(getHourInt(notification.getDateAndTime()));
            Day[i-1]= Integer.valueOf(getDayInt(notification.getDateAndTime()));
            Month[i-1]= Integer.valueOf(getMonthInt(notification.getDateAndTime()));
            Year[i-1]= Integer.valueOf(getYearInt(notification.getDateAndTime()));
            mThumbIds[i-1]= Integer.valueOf(notification.getIcon());
            database.close();
        }

   }

}

日志:

03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2154)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:178)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at com.universe.time.proffesionaldiary.ui.fragments.OneDayTasks.onCreateView(OneDayTasks.java:68)
03-12 07:34:51.908 24239-24239/com.universe.time.officereminder E/art:     at android.app.Fragment.performCreateView(Fragment.java:2114)

1 个答案:

答案 0 :(得分:1)

您在日志中看到的问题出在OneDayTasks片段中。

onCreateView() <fragment>中,您为OneDayTasks提供了onCreateView()标记的布局,导致再次调用fragment,依此类推。当你的堆栈内存不足时终止的无限递归。

要解决此问题,请从您在片段代码中扩充的布局中删除vectorizer = DV( sparse = False ) X = vectorizer.fit_transform(cat_dict ) print len(X) feature_names = vectorizer.get_feature_names() reg = RandomForestRegressor(n_estimators=50, max_depth=None,min_samples_split=1, random_state=0) reg.fit(X,Y) scores = cross_val_score(reg, X, Y) print scores reg.fit(X,Y) importances = reg.feature_importances_ indices = np.argsort(importances)[::-1] for f in range(X.shape[1]): if importances[indices[f]] > 0: print("%d. feature %d (%f)" % (f + 1, indices[f], importances[indices[f]])) print ("feature name: ", feature_names[indices[f]]) 自引用。