Android no such table (not found)

Source: Internet
Author: User

Today in the study project, has been error no such table Users. Said the users table could not be found. I was wondering, the database is copied in the past, check the table name is not written wrong. What's going on here? Check for half a day only to find that the original database path is wrong.

I copied the database to the SD card, but I used the Android to inherit the Sqliteopenhelper way in the Getreadabledatabase () method to get the database. As we all know, the default database path in Android is:/data/data/package name/databases/database name. Therefore, the Getreadabledatabase () method that comes with Android is also the database that is found by default path. So, to solve this problem, either copy the database to the default path, or write the database helper class yourself.

I chose the former.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.