I want to show an error message if no item is selected from the AutoCompleteTextView. Here is my XML Java Code It is not working What am I doing wrong? Answer If I set an error on customerSpinnerLayout then it works Everything is the same as above you just have to change the condition It works for me. Best of
Tag: android-studio
How to make sure a player is touching the game piece before allowing them to move it
I am trying to make it so that the game piece (red square) cannot be moved unless the player initially clicks on it, but can then drag it freely until releasing it. Currently, if the player clicks anywhere on the the screen the game piece will move to their cursor/finger when they start moving it. If I try to use
Detecting interactions between Canvas objects
In my current prototype I have a fixed grid of rectangles I draw on the canvas in a loop, and a red square “gamePiece” which can be dragged around the screen by a player’s finger (screenshot below). My goal is to make it so that the player square can interact with the grey squares, but I’m not sure how to
Get imageView resource
i have been searching for hours, and cant seem to find an answer i have a chess board and its made of 64 imageViews (8X8) and i want to move one pawn to another square, and cant seem to find the way to get the image resource (which is a png image) and set it on the empty square. i
Using one Google Maps Activity, call a method using three different buttons
I have an android application in which I have 3 buttons and by pressing them I want to call three different Google maps markers, by using the same google maps activity. CLASS WITH 3 DIFFERENT BUTTONS and then my GOOGLE MAPS ACTIVITY CODE This is what I’ve done so far, but I can’t find a way to use the same
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8
I’m trying to use a physical Android device to test/debug my React Native project. I connected the device to my Windows 11 machine via USB and turned on Developer mode on the device but when I tried to run my project, I got an error stating the following: Android Gradle plugin requires Java 11 to run. You are currently using
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 being converted into JSON and saved instead of
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 worked in setOnClickListener but it doesnt work setOnLongClickListener I want to
How to get latitude and longitude separately in 2 textviews in android studio JAVA?
from this i’m getting latitude and longitude in a single textview. But I want the latitude to be in 1 textview and longitude in another text view. Please help me on this. My main activity my geocodinglocation class.java from this i’m getting latitude and longitude in a single textview. But I want the latitude to be in 1 textview and
How to change an already generated project language from Kotlin to Java in Android Studio?
I created a project using kotlin as the prefer language but for some reasons I want to use java. I don’t want to create this project over. Answer Just create a file with extension .java and work on that