I’m making a super simple BMI calculator app using Java in android studio but I’d like to make it so that the user is only able to enter sensible values for their height and weight. I was thinking something around 50cm-220cm for height and 3kg-150kg for weight. As it stands, they can enter any num…
Tag: android
Activity does not have a NavController set on
I basically set up 3 fragments for my bottom navigation view with all linked to activity.xml activity.xml where I put fragment tag. My Activity.java code (specifically): The problem now is that if I run that same java code using fragment tag in xml, it runs well but suggests I use <androidx.fragment.app.Fr…
Convert string to specific int
I am creating foreground notification with ID like so: startForeground(1, notification) When initialising the service I am sending to it some string (ex: Hello). I wish that the service and notification will be bind to this string so I wish to use it as my id. So, how can I convert string to unique ID? For ex…
I’ve received single item from api
I trying to display temperature values that came from the API response in RecyclerView. The thing is my program constantly display just one, first item. I’m not sure where can be the issue, and I feel …
View not clickable after translate in CoordinatorLayot
I have a ConstraintLayout wrapping my FABs section in the bottom right of the app. I use a layout and not only the buttons because I have more views all around the FABs (they are omitted in the example below, the real layout is more complex). The layout has a CoordinatorLayout as main parent. I have two FABs,…
react-native app error when try and test in emulator(?)
I get this error below whenever I try to test the app after typing the command npx react-native run-android. I tried setting paths in environmental variables. But still doesn’t work I tried reinstalling react-native but still does not work. I tried to reinstall JDK from java but finally, the app still d…
How do I query a user’s info in Firestore if all my document IDs are auto-generated?
All of the examples I’m finding online have very simple document IDs, but what do you do if you’re auto-generating all your IDs (as the docs say you should)? For example, I want to query the date when the user was created. The document ID for this is below, but I’ve just copy-pasted it from …
Can’t use LeakCanary because of org.junit.Test class dependency in external libraries
I’m trying to use LeakCanary for finding memory leaks in my Android application. I’m using Android Studio. When I start debugging my application I see “LeakCanary is currently disabled: test class org.junit.Test was found in classpath.” message. “org.junit.test” class came …
How can I load previous data and continue adding to its value (numbers/int) using buttons?
I’m new here and new to android studio, hope you can help me. I am trying to make a simple counter app. I have a button that adds +1 to the value of my textview(int) and a button that saves that value …
How to parse this json with multiple objects
devs I am stuck in parsing this kind of JSON I don’t understand how to get the value of status and message any help will be very appreciable. I get the value of error but when I want to access the value of status and message it throws an error JSON Format : My code for parsing json : Answer