My app has a hierarchy of Activities, A -launches- B -launches- C
In the third Activity 'C' I have a button.
In the onClickListener of this button I launch an Intent as follows:
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse(uri));
startActivity(intent);
//I don't call finish()
It brings up the phone dialling dialog fine. If I hit the back button at this point I get the "Sorry!" popup saying my app stopped unexpectedly. On hitting the "Force Close" button my app reverts to the Activity 'B' rather then the expected 'C' (Assuming no crash).
Activity 'B' does use the SQL query shown in the exception however I don't know why it is causing the exception when I hit 'Back' as it has nothing to do with Activity 'C'. My database has been closed and I don't get an Leak warnings.
In Activity 'B' the database is opened immediately prior to executing the query and closed afterward. Struggling with this all day so would appreciate any comments.
Uncaught handler: thread main exiting due to uncaught exception
java.lang.IllegalStateException: mQuery SELECT islocal, packageid, Name, mapradius FROM categories WHERE islocal=? 1
at android.database.sqlite.SQLiteQuery.requery(SQLiteQuery.java:162)
at android.database.sqlite.SQLiteCursor.requery(SQLiteCursor.java:536)
at android.app.Activity.performRestart(Activity.java:3740)
at android.app.ActivityThread.handleWindowVisibility(ActivityThread.java:3312)
at android.app.ActivityThread.access$2600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1890)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4370)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteMisuseException: library routine called out of sequence: handle 0x0
at android.database.sqlite.SQLiteProgram.native_bind_string(Native Method)
at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:178)
at android.database.sqlite.SQLiteQuery.requery(SQLiteQuery.java:153)
... 13 more
ERROR/SemcCheckin(17282): Get crash dump level : java.io.FileNotFoundException: /data/semc-checkin/crashdump