Android ORMLite -
I am using ormlite for Android 4.47. All are good, but sometimes when the application runs, I get an exception with the next reason:
before you do it I can use my application class I'm a doctor in writing like init ormlite.
DatabaseFactory.setHelper (applicationContext); What's going on? This exception does not get me often, perhaps in a day.
Full stack:
java.lang.RuntimeException: An error occurred while executing doInBackground (android.os.AsyncTask $ 3.done () java.util.concurrent on java.util.concurrent.FutureTask.finishCompletion (FutureTask.java:355) on java.util.concurrent.FutureTask.setException (FutureTask.java:222) on .FutureTask.run AsyncTask.java:300) java.lang.Thread At java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java--), at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1112) (FutureTask.java, 4242). Because of the run (Thread.java:841): java.lang.IllegalStateException: Start () before you can use claims on com.j256.ormlite.dao.BaseDaoImpl.checkForInitialized (BaseDaoImpl.java:925) on com You must call .j256.ormlite.dao.BaseDaoImpl.queryBuilder (BaseDaoImpl.java:247) com.j256.ormlite.dao.BaseForeignCollection.getPreparedQuery (BaseForeignCollection.java:174) com.j256.ormlite.dao.EagerForeignCollection Is at & lt ;. Init & gt; (Curious ForeignCollection.java:38) com.j256.ormlite.field.FieldType.buildForeignCollection (FieldType.java:784) com.j256 com.j256.ormlite.stmt.mapped.BaseMappedQuery.mapRow (on BaseMappedQuery.java:82) At .ormlite.stmt.SelectIterator.getCurrent (SelectIterator.javaociety70) com.j256.ormlite.stmt.SelectIterator.nextThrow (SelectIterator.java:161) com.j256.ormlite.stmt.StatementExecutor.query at (StatementExecutor .java: com.j256.ormlite.stmt.StatementExecutor.queryForAll at com.ls.dailysteals.core (StatementExecutor.java:118) at com.j256.ormlite.dao.BaseDaoImpl.queryForAll (BaseDaoImpl.java), 200 ). database.dao.HeistDAO.getAllHeist (HeistDAO.java:31) com.ls.dailysteals.ui.fragment.HeistFragment $ 1 on com.ls.dailysteals.ui.fragment.HeistFragment $ 1.doInBackground (HeistFragment.java:92) On. doInBackground (HeistFragment.java:88) on java.util.concurrent.FutureTask.run on android.os.AsyncTask $ 2.call (AsyncTask.java:288) (FutureTask.java:237) on java.util.concurrent.ThreadPoolExecutor . runWorker (ThreadPoolExec utor.java:1112) java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:587) at java.lang.Thread.run (Thread.java:841) Init:
Increases the public class DSApplication application {Private stationary applications apply; @ Override Public Empty on Create () {Super. Connet (); DatabaseFactory.setHelper (applicationContext); }} The first call: The discretionary (...) slice was called in the method of life;
databaseTask = new asynchronous task & lt; Object, list & lt; ShortDeal & gt; List & lt; ShortDial & gt; & Gt; () {@ Override protected list & lt; ShortDial & gt; DoInBackground (object ... parameter) {return DatabaseFactory.getHelper (). GetShortDealDAO () GetAllShortDeal (); } @Override Secure Zero on PostExecute (List & ShortDial> ShortDials) {super.onPostExecute (shortDeals); UpdateAdapter (shortDeals); }}; If (Build.VERSION.SDK_INT & gt; = android.os.build.VERSION_CODES.HONEYCOMB) {databaseTask.executeOnExecutor (AsyncTask.THREAD_POOL_EXECUTOR); } Else {databaseTask.execute (); }
I have never used ORMLite, but MT is estimated because This is your apptontotect is always nullified, thus it thinks that it is not bizarre
increases the public class DSApplication application {Private stationary applications apply; @ Override Public Empty on Create () {Super. Connet (); applicationContext = this; DatabaseFactory.setHelper (this); } ....
Comments
Post a Comment