SQLiteException: no such table

后端 未结 9 594
礼貌的吻别
礼貌的吻别 2021-01-06 08:26

I am using my own SQLite3 database as opposed to creating a new one each time my app runs, as I have a few tables with static data that I am trying to display. I created my

相关标签:
9条回答
  • 2021-01-06 08:38

    I just had a simple mistake.

    Reason:

    Solution:

    0 讨论(0)
  • 2021-01-06 08:48

    Using SQLiteOpenHelper.onCreate() does not create a new database every time your app starts - rather it creates a database if it does not already exist.

    It sounds like you might have an empty database created by or for your helper (if there was no database at all, I might expect a different exception), and your separate database that you created outside of Android. Looks like you and your app are not looking in the same place for your data.

    0 讨论(0)
  • 2021-01-06 08:49

    Have you moved the database from the assets folder to /data/data/YOUR_PACKAGE/databases/ on the emulator?

    This is a good detailed post about moving the database to /data/data/YOUR_PACKAGE/databases/ if it does not exist.

    Here is another short and simple solution to it.

    0 讨论(0)
  • 2021-01-06 08:50

    Clear Data and uninstall application from your device and re-install application in device...

    Settings -> Applications -> Manage Applications -> Your Application Name -> Clear data
    
    0 讨论(0)
  • 2021-01-06 08:53

    Settings -> Applications -> Manage Applications -> (Click on your application) -> Clear data

    0 讨论(0)
  • 2021-01-06 08:53

    Just clearing the data did not work for me.

    What worked was:

    • Uninstall app
    • Restart device or emulator
    • Disable Instant run (Not just the main group but all individual instant run settings)
    • Build -> Clean Project
    • Build -> Rebuild Project
    0 讨论(0)
提交回复
热议问题