You could try putting a try/catch block around the offending statement to
catch a generic exception, maybe finding out exactly what exception pops up
might give you a clue?
On Dec 5, 2014 4:00 PM, "Jim Graham" <[email protected]> wrote:

> I'm trying to use an SQLite table with Android (and for almost the first
> time, period, but I familiarized myself with it using SQLite3 /
> tclsh8.4), and I've run into a bit of a problem where I can't seem to
> spot the error.....
>
> Here is the code where it's failing and force closing:
>
>    ---------------------------  CUT HERE  ---------------------------
>
>    // global - before start of DataBaseHelper class:
>    private static final String TABLE_GRAINBRANDS = "grainbrands";
>
>    // much later in DataBaseHelper
>
>    List<String> grainBrandsList = new ArrayList<String>();
>    String selectQuery = "SELECT  * FROM " + TABLE_GRAINBRANDS;
>    String brand;
>
>    SQLiteDatabase db = this.getWritableDatabase();
>    Cursor c = db.rawQuery(selectQuery, null); // This is the line (75)
>                            // that logcat says causes the force close
>
>
>    ---------------------------  CUT HERE  ---------------------------
>
> Surrounding logcat code:
>
> ---------------------------  CUT HERE  ---------------------------
>
> I/ActivityManager(15152): Start proc com.jdgapps.andgtbrew2 for activity
>       com.jdgapps.andgtbrew2/.AndGTbrew2: pid=28296 uid=10327
>       gids={1015, 1028}
>
> I/ActivityManager(15152): Displayed com.jdgapps.andgtbrew2/.AndGTbrew2:
> +3s183ms
>
> E/AndroidRuntime(28296):
>    at
> com.jdgapps.andgtbrew2.DataBaseHelper.getGrainBrands(DataBaseHelper.java:175)
>
> E/AndroidRuntime(28296):  at
> com.jdgapps.andgtbrew2.AndGTbrew2$1.onClick(AndGTbrew2.java:92)
>
> W/ActivityManager(15152):   Force finishing activity
> com.jdgapps.andgtbrew2/.AndGTbrew2
>
> W/ActivityManager(15152): Activity pause timeout for
>    ActivityRecord{4280e468 com.jdgapps.andgtbrew2/.AndGTbrew2}
>
> I/ActivityManager(15152): Process com.jdgapps.andgtbrew2 (pid 28296) has
> died.
>
> ---------------------------  CUT HERE  ---------------------------
>
> Unfortunately, this error message doesn't tell me much, and while looking
> between tutorials and my code here, I can't see what's wrong with it.
>
> I tried to check in /data/data/com.jdgapps.andgtbrew2/ to see if gtbrew2.db
> was there, but /data was empty, so I gather it's hidden.  Good security,
> normally, but a PITA right now.....
>
> Logcat does not show any of the errors that would be generated if the
> dabase copy (from assets to the above) failed, so it should be there.
>
> Does anyone see anything that I might have missed?
>
> Thanks,
>    --jim
>
> --
> THE SCORE:  ME:  2  CANCER:  0
> 73 DE N5IAL (/4)          |
> [email protected]      | TeX actually recognizes several kinds of
> < Running Mac OS X Lion > | infinity, some of which are ``more infinite''
> ICBM / Hurricane:         | than others.
>    30.44406N 86.  59909W  |       --Donald Knuth in {The TeXbook}
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to