I used this Youtube Tutorial: https://www.youtube.com/watch?v=AkUfACbi6BE to create an Open Answer quiz in Android Studio using Java. I followed the tutorial exactly, but when I ran the code on a device, even if I answer questions incorrectly, it says I won the game. I am not sure why it isn’t validatin…
Tag: android
How to detect new lines from a Json text in Java, Android
The text is received from a Json is like this: I don’t know how to detect that empty space in java/Android. I want to replace the new lines from the Json with <br/> because I’m trying to find a workaround to this problem: Android, format text from Json to HTML removes new lines and white spa…
How do I save the state of CheckedTextView checkbox so it stays checked after exiting?
So I kinda screwed up while making the checkedtextviews, didn’t realise i needed to save the state, I don’t know how exactly to do it. Any advice would be greatly appreciated. Answer I’m not familiar saving data yet, I know that there is a lot of ways of doing that so i’ll give one exa…
Getting “error: package androidx.core.content does not exist” when trying to build android project with FileProvider
I am relatively new to Android development, and I’m using Android Studio for development. I am trying to work with the camera for my app, and I’m trying to follow the instructions here https://developer.android.com/training/camera/photobasics. It says to use the FileProvider class, but when I try …
How to set filter property in ImageView Android studio
I have a yellow sparkline png and I would like to change the filter by adding some css. Colors will change according to positive or negative number. So, if the number is negative, the line should be: CSS If positive: ImageView: MainActivity.Java EDIT: What I have: What I want: EDIT: Now I used an ImageFilterV…
Deprecated method “startActivityForResult()” vs properly bluetooth set up
Hey I try to make bluetooth service according to the information on the official android dev website. But I came across to the deprecate method startActivityForResult(). What should I do to properly turn on bluetooth device? Here is my code with deprecated method: Answer It’s a special AndroidX extension that…
Using GridView in XML, getting java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView
Every time I try to start my app it crashes leaving this message in logcat Caused by: android.view.InflateException: Binary XML file line #15 in com.example.connect3game:layout/activity_main: addView(View, LayoutParams) is not supported in AdapterView Caused by: java.lang.UnsupportedOperationException: addVie…
react-native run-android does not work :/
Running react-native run-android in windows but get this error: I have installed android studio and created a project and I also run the emulator and i did Answer You could try this one react native environment setup from react native official documentation or this react native environment setup from tutorial…
Error org.threeten.bp.format.DateTimeParseException
I know that there is a lot of similar questions like this but cant apply these solutions on them. i am trying to transform date that i am getting from server int this format: 2019-07-26T02:39:32.4053394 and then i am trying to convert it to milliseconds like this: in my onCreate i call this method: but keep g…
Using Firebase open a different activity if user logged in second time
I am using Firebase in my project. What I want?? When a new user logged in, he goes through all activities (like Information activity, etc) after login and then to the dashboard. when that user logout from the app and logged in again then directly go to dashboard not need to fill that all information again. I…