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 3330612
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:30:29+00:00 2026-05-17T23:30:29+00:00

I have four tabs which the first one inserts data on the database, the

  • 0

I have four tabs which the first one inserts data on the database, the other 2 tabs take care of displaying the data using a cursor. here is my problem though when I first start the app and there is nothing on the database if I press one of the 2 tabs it gives me this error:

ERROR/AndroidRuntime: Caused by: android.database.sqlite.SQLiteException: no such table

my question is the following how can I avoid getting this error when pressing one of 2 tabs, I would like just to display an empty tab with an empty list.
Here is a piece of code where the error happens:

void populate() {
    array = new ArrayList<String>();
    mydb = openOrCreateDatabase("vivo_id.db",
            SQLiteDatabase.CREATE_IF_NECESSARY, null);
    Cursor c = mydb.query("VIVOID", null, null, null, null, null, null);
    // start the managing cursor
    startManagingCursor(c);
    // move to first row
    c.moveToFirst();
    // continue searching until it is the last row in the column
    while (c.isAfterLast() == false) {
        sharable = c.getString(c.getColumnIndex("isCouponSharable"));
        coupon = c.getString(c.getColumnIndex("couponImageResult"));
        rawImage = c.getString(c.getColumnIndex("couponThumbnailResult"));
        keyword = c.getString(c.getColumnIndex("keyword"));
        histDesRes = c.getString(c.getColumnIndex("couponDescription"));
        history = keyword + " \n " + histDesRes + " " + "<@>" + ""
                + rawImage+""+"<@>"+""+coupon+""+"<@>"+""+sharable;
        array.add(history);

        c.moveToNext();
    }
    strings = array.toArray(new String[array.size()]);
    // close everything

    c.close();
    mydb.close();

}

Any help or pointers would be greatly appreciated, Thank you so much in advance.

  • 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-05-17T23:30:30+00:00Added an answer on May 17, 2026 at 11:30 pm

    I was missing the most imprtant element which the following, I learned from it hopefully other people will as well.

    myDbHelper.getReadableDatabase();
    @ the beginning of the function.

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

Sidebar

Related Questions

I have a Tab bar App with four tabs. Each tab loads the same
I have four tabs (reports, review reports, map and settings). I have an sqlite
I have an tabbar-application with four tabs. Every tab loades an nib with its
In Windows Forms the default behaviour of a TabControl is to have the tabs
Basically, if I have a line of text which starts with indention, what's the
To set tabs in emacs I have this line in my .emacs: (global-set-key (kbd
I have an app that has a UINavigationController that pushes a UITabBarController into view.
I have a page with a jqueryui tabset on it. I'd like to be
I've run into an animation issue (I think) with my TabBar based app. I
I just found out how easy it is (or at least is supposed to

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.