I am trying to access the activity on which my Imageview is, so I can use the URL of an Image of type SVG and display it to the user using the GlideToVectorYou library. But when I try to get access to the activity using R.layout.activityname, a syntax error appears. this is the code that I’m using Thank…
Tag: android
GSON flat down map to other fields
So I have an Android app which uses Retrofit for API. I have a class like which looks like: When GSON creates a JSON it looks like: Would it be possible to change JSON serialization to: Thanks. Answer Here is how Gson could be used to implement the flattening: I’ve put some comments explaining “wh…
How to retrieve multiple username from Firestore and assign the username to the correct markers on map
The code shown below is the code used to retrieve the multiple users location from Realtime Firebase and assign to the markers on map: The structure of the real-time firebase is as follow: The result of the code is as follow: When I click on the marker, it only shows the userID of the user. I want the marker …
How to parse array inside json object in android java?
how to display array data in json object if the json data is like below. I want to display array data of Ingredient and step. This is the full API Address that I want to fetch the data https://masak-apa-tomorisakura.vercel.app/api/recipe/resep-nasi-bakar-ayam I’ve tried several ways but I can’t fi…
How to read data from nested array in Firestore
I have the below structure in my Firestore and I want to read data and store it in ArrayList like I have “amountArrayList” which will read data from the “transactions” field in Firestore, I want to read all the “amount” fields from “transactions” field and make …
position android buttons on absolute view became nested buttons. only 1 btn shows
when i build this code, app will open on landscape mode. but all of my buttons are nesting and it shows only 1 btn how can i solve it? i had tried by constraint view, but it was same. this is my github https://github.com/sksmsWKd/2021android-backup/commit/cb6bb1774b3f8307f211ed6feb16eab0a9bf3620 i pushed this…
Why is my LinkedHashMap being incorrectly converted to JSON and saved in SharedPreferences?
I’m trying to save an object in SharedPreferences but first converting the object to JSON as shown below. However, the object is being both incorrectly converted and saved. The JSON looks like this: This makes it impossible to save and retrieve the schedule. Why is the name of the schedule file address …
Can I order firebase addValueEventListeners so that they execute in a specific order? [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. This post was edited and sub…
How to get id data from database deleting – setOnLongClickListener ERROR
I have a recyclerview and sql lite database. I keep city names in SQLite database and display them in recyclerview. When the city is setOnclickListener in the recyclerview, the city’s weather is shown and I do this by taking the city’s id from the sql lite database. arrayList.get(position).id it w…
Failed to read key key1 from store even tho key is 100% correct
I am trying to create a release build for my app, but no matter what I do, it does not work. I get this error everytime: Task :app:packageRelease FAILED I created so many keys and passwords and this time (every time created it new), but it always says “keystore password was incorrect” even tho it …