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:
Tag: android
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
Unchecked assignment: ‘java.util.List’ to ‘java.util.Collection’
I am having an adapter where i have two lists one list is for InvestorsList where it comes with the list of investors and the other list is called investorListFull which is used to filter results when searching. Below is how i have declared the lists Below is how the lists are assigned in my recyclerview adapter constructor Below is
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,
Intent with multiple if statements
I am learning the concept of Intents and the application I am working on crashes when I try to go from any other intent that’s not “Arabica” intent, the intent object is fired on onItemSelectedListener on a spinner. I want to make it so that when the user selects the other options on the spinner it will execute that intent
Displaying data from Firebase into custom Info Window
I’m trying to display a couple of user details from Firebase into a custom Map Marker after the location data has been retrieved from the database but I don’t know if I should implement FirebaseRecyclerAdapter or a normal one. How should I do this? I’m trying to at least retrieve the user’s name, emergency type, and alert level and display