Skip to content
Advertisement

Tag: android-sqlite

Unable to fetch unread messages from SMS inbox

I have successfully retrieved all messages from inbox but I want only unread messages . I have also apply in the query as read=0 which gives unread SMS but it can’t retrive unread messages it retrieves all messages. Answer Change your query arguments like this You are passing selection where clause for read = 0 in projections instead of where

Android and SQLite: “nested” getReadableDatabase

In my Android app I use the following code to access db: method1 and method2 can be called independently from outside the class. In addition, there are situations where method1 must call method2. In method2 I need a db instance, so I should call SQLiteDatabase db = helper.getReadableDatabase();. This is ok if method2 is not called by method1. On the

save text file in sqlite android

I want to save text file in sqlite android but it is giving an error android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed: at line long result = db.insert(TABLE_NAME,null,cv);. The path gives this in log Download/Link_on.txt and the readFile(path) returns [49, 10, 48, 48, 58, 48…… but it is still failing to save the text file in db. Thanks for the help. Answer

Why my bookmarked words doesn’t saved to sqlite database if i want to add them from another fragment?

The main problem is that when i add bookmark codes from direct recyclerview it works perfectly fine but when i add those codes to another fragment it just only show a toast that bookmark is added or deleted but that bookmarked word doesn’t show in favorite list. Here is my Database codes My RecyclerView codes My Detalis Fragment codes My

Advertisement