DEV Community

Nesh
Nesh

Posted on

Need help in Android

How can i create a program in Android Using Java.... Where on button click i can get random string value in textview from Array ...?

Top comments (1)

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

Hi Nesh, this is a very very vague question.
A couple of pieces of software would be appreciated to spot the issue and, if you didn't try it first please, head to the Android Reference first and make a try before asking.

It's worth mentioning that while you can write Android Apps using Java, the official language for Android, to code in Android Studio is Kotlin.
It's similar to Java but with some changes into the syntax and some different quirks.

On the other hand, I've not developed in Android (other than webviews) since the lollipop times but if I don't remember it wrongly you need to define a button in the UI with an ID and then use findViewById in the code to reference that button and apply some logic into it.

See Android Buttons Reference for more details.