I made an Android application where the users ask questions, but they may use programming codes in their questions. How can I separate the programming codes from the normal texts in Kotlin? If you can explain, I want to change the background of the codes. Like this enter image description here Answer just use something just like stackoverflow i.e. put
Tag: android-studio
App crashes when I press “continue” button (transitioning between activities)
I am creating an app where you log in and then access a database of files unique to each user account. I have a continue button linking the “LoginActivity” and “MainActivity” activities together. The code that I have in the LoginActivity file is this: and on the MainActivity side I have this: What is wrong with my code? I can’t
How to store the data in the list without overwritten the data?
I am working on the json array loops to output the data so I can store them in the EmailAddressData list. I have got a problem with this line under the loops: It will overwritten the data each time I fetch it and store it. I dont know what other ways I could use to store the data. It will
Why does my Android studio App crash when I spam click at the beginning of an activity?
The app works fine if I wait a bit after clicking play, but if I want click on anything clickable right away, the app crashes. Here is the error message: Here is my GameView class: Answer The call stack tells you that in the method Joystick.getIsPressed you are trying to convert a Boolean object to a boolean by invoking booleanValue()
Use same GPS location code on multiple fragments
I want to make an application that will include five different fragments. In each fragment I need the GPS location of the device but the purpose will be different. In order not to implement FusedLocationProviderClient five times for each fragment, I was thinking of doing this once in MainActivity and sending the results to the displayed fragment. Being a beginner
Cardview not displaying
I am trying to use com.google.android.material.card.MaterialCardView to display images and text. In the xml file it appears to be correct but when running the application, the card view is blank not even a text. Below are my xml file and grade file. The actual output I want also is shown in the picture (expected output) and the actual result is
Trying to change custom dialog Background color
Ok so I am trying change my background of my dialog box from white to a dark blue. However when I long press on one of the grid elements the dialog box looks like this: I am trying to make it look something like this (this is a photoshop): Here is snipet of my XML code for the edit dialog
recycler view hides message upward when keyboard is open / how to keep recycler View from scrolling when keyboard is on
I am making chat app but when I send message recycler view does not show first 2 messages because it is up I want something like whatsapp if I open keyboard recycler view is shown from start I tried following but it sticks chats to end even after I close keyboard: . following is my code: } following is my
how to change the background color of my listview based on a given data as a parameter in android
I have an android application that basically scan a barcode. I have a lists of items and I would like to change a color of my list once the item has been scanned. Please find the image below for reference. I would like to change a background color of item to red only if the item remaining is zero. There
Android Studio, generate Ormlite Configuration File (ormlite.txt), gradle complains “The JavaExec.main property has been deprecated.”
Ormlite is a library to do object-oriented access to sqlite. It requires that we generate an ormlite.txt file which contains the processed configuration of the database objects in my android project. In addition to my Android run configuration that will actually launch the Android app, I created an Application run configuration to just execute the main() method. This is how