Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8191955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:03:05+00:00 2026-06-07T04:03:05+00:00

I am using a cursor to access a sqlite database I have in my

  • 0

I am using a cursor to access a sqlite database I have in my app.

I am having trouble using the .getInt() on my database. My database is pre-created, and I have a few cursors that perform queries to interface with the information. Several of the columns in one of the tables are set as INTEGER type. I realize that sqlite has no built in check to make sure columns are indeed INT. However, when retrieving the data, I can use the .getString() function without any issues, but calling .getInt() causes the app to crash. Below is the relevant code. If I am missing anything, please let me know, and I’ll add it in.

Any help is greatly appreciated. Thank you very much.

Cursor:

public Cursor getSkitStats(int module, int skit) {
    Cursor mCursor = myDataBase.rawQuery("SELECT * FROM score WHERE mod="+module+" AND skit="+skit+"", null);
    if (mCursor != null) {
        mCursor.moveToFirst();
    }
    return mCursor;
}

and I am using a simple Toast call to output the result of the query:

Toast.makeText(getApplicationContext(), scoreContent.getInt(0), Toast.LENGTH_SHORT).show();

The variable scoreContent is the cursor.

And here is the crash output:

07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.app.ActivityThread.access$1500(ActivityThread.java:121)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.os.Looper.loop(Looper.java:130)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.app.ActivityThread.main(ActivityThread.java:3701)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at java.lang.reflect.Method.invokeNative(Native Method)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at java.lang.reflect.Method.invoke(Method.java:507)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at dalvik.system.NativeStart.main(Native Method)
07-08 23:53:31.726: E/AndroidRuntime(15685): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x2
07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.content.res.Resources.getText(Resources.java:205)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.widget.Toast.makeText(Toast.java:258)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at jp.atomicideas.ne.Summary.onCreate(Summary.java:90)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-08 23:53:31.726: E/AndroidRuntime(15685):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
07-08 23:53:31.726: E/AndroidRuntime(15685):    ... 11 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:03:07+00:00Added an answer on June 7, 2026 at 4:03 am

    If you are sending an int to Toast.makeText , it assumes it is a resource id. see here:

    http://developer.android.com/reference/android/widget/Toast.html#makeText(android.content.Context, int, int)

    If you just want to print a number, use toString() to convert it to a String. (or Integer.toString() etc.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using an sqlite database in my app. I have this dbhelper class in
I have a stored procedure in oracle which is using cursor.Its fetching the data
How can I get a transparent cursor using Python GTK3 and pyGObject. I have
I've populated a ListActivity from a Cursor using SimpleCursorAdapter that starts another activity when
How do I get a tooltip that is attached to the mouse cursor using
I have some problem with the cursor when using JOprionPane. I set a cursor
please how can I use the database (I have created with Eclipse and I
I have problem with using class instance in Python. Ive created a new class
I'm currently building my first app for Android. What I'm having trouble with is
I'm using Access via OleDb. I have a table with columns ID, GroupID, Time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.