Skip to content
Advertisement

Tag: android

Getting UNIQUE constraint failed: tbl_data.id (Sqlite code 1555 SQLITE_CONSTRAINT_PRIMARYKEY) error in android studio room

I’m getting this error while i have initialize the id as primary key and i added the unique attribute. Data class code : Data Base Class code : and main activity code : and full error in logat : 2021-11-07 12:20:45.070 24994-24994/com.mohajer.kitset2 E/AndroidRuntime: FATAL EXCEPTION: main Process: com.mohajer.kitset2, PID: 24994 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mohajer.kitset2/com.mohajer.kitset2.MainActivity}: android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed:

How to display already checked checkboxes in recyclerview, on activity start-up(many to many relationship)

Each “Note” is differently “added” to “Folders” or should I say, different checked “Folders” for each “Note”. When I check the “Folder”, go back to previous Notes activity with back button, then open the same “Note” to go to “Add to Folders Activity” and add the “Note” to Folders, it should remember that previously checked “Folder” and recheck it. I

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

How to send data to Android Wear TileService

I don’t really know, how to feed my Wear OS tiles with data. Currently, I am experimenting with receiving my heart rate from a BroadcastReceiver, which works but my value is always 0 inside onTileRequest. This is my TileService… This is what I get… As you see onTileRequest is always 0. Maybe it’s because onCreate gets called too whenever onTileRequest

How to parse JsonObject without JsonArray?

I have an json like this: But I could not get string objects from “data” tag using volley because there is no any json array to foreach tag. I tired and I search so much examples. I could’nt find any solution from stacoverflow. Any one can help me? Answer I am not familiar with Volley, but a straightforward way is

error: Not sure how to handle insert method’s return type

So I’m trying to use Executor execute the Dao’s in my android app, but when I created the Executor, it said it required the method being run to have a Runnable return type? So I made them all return Runnable, but now Android Studio gives me the error: Dao: Repository: Dao_Impl I’ve been told I need to use Executor for

How to make context not null in onCreate()?

I’m trying to get the context in the onCreate() method, to use in my RoomDb repository, but it keeps giving me a NullPointerException. repository I’ve tried to look through other explanations, but I just can’t wrap my head around it. I’ve tried GetApplicationContext, and this. I’ve seen people saying to call the getApplicationContext at the end of the onCreate() method,

Advertisement