I have about 25 buttons, a RadioGroup with 4 radio buttons all in one layout. Which change what the buttons do. To reduce the number of lines and make the code more efficient I am trying to initialize the radiogroup and radioButtons on a different Kotlin file that is not the Main Activity (inside onCreate function). Is there a way
Tag: android-studio
Need help outputting “You must enter a name” when nameText is null. With the code I currently have it doesn’t recognize when the nameText is empty
MainActivity Need help setting the text to “You must enter a name” when the nameText is null. For some reason even when the nameText field is empty it still outputs “Hello” when it should be outputting “You must enter a name”. Answer Probably you need to check if the text of your EditText is null, not the EditText widget itself.
R.layout.activity_noconnection error in android studio
I recently changed my package name using this method. but now when im trying to create a new activity its giving me an error on R.layout.activity_noconnection (on R). then i pressed alt+enter to fix the error it imported “import OldPackageName.R” and that fixed the issue, so that means my old package name is still there in in the program .
How would I go about turning JavaScript into Java? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 9 months ago. Improve this question I would like to use the following code in Android studio, instead of via a web browser. However, I am
Why is my app Crashing with RecyclerView?
I’m doing a recycler method in my android studio project but i have a problem. Everytime i’m trying to findViewById my application is crashing. And i don’t understand why because i’m creating my view in the good way. And i’m trying to continue with that But i’m crashing at the line recyView = view.findViewById(R.id.recyclerBuy);. My R.id.recyclerBuy is not empty. And
near “”: syntax error in SQL with android studio
I’m working on a SQL databse on java (android studio project) but i have a weird mistake. Basically, everytime i have I have tried like this My DBS is And i really don’t see where is the mistake. Because they’re saying “syntax error”, but for me, it’s look pretty OKAY. Anyone have a clue ? I’m just trying to insert
Why cant I initialize the Webview
im just starting out with android studio, i have imported WebKit but those imports are grayed. and i cant initialize the webview “private WebView webview” shows errors how to do it correctly? Answer I was using kotlin instead of java that was the issue (beginner mistake lol) my issue was that i couldn’t initialize the webview on my code. but
MenuItem and toolbar missing in new activity Android Studio Unknown Bug
I am completely new to Android Studio and just learned Object-oriented programming. My project requires me to build something on open-source code. I added a new menu item to a menu and want to start another activity once the user clicks the menu item with id: plot. The intent will be sent from if (id == R.id.plot) within onOptionsItemSelected(MenuItem item)
How to prevent saving empty data in SQLite database
I dont want to save empty data in my Note App. I have tried Everything but when I leave Edittexts empty it still saves data into my data base. what should I do? this is my insertNote method and this is the method that saves my notes in my AddNoteActivity i have also tried this but this is but this
Android Studio strings.xml: ‘NBSP’ suddenly appeared in my strings.xml files
I suddenly have the mention ‘NBSP’ in my strings.xml files, just before special characters (!, ?, ….) These ‘NBSP’ do not appear in my app when I run it. Also, when I do a copy/paste, they are not copied. I have hundreds of them in many languages. They are not found in Android Studio by CTRL+F. A mess to remove…