Im a beginner in android and need your advice:
1. The app is about to send a message (sms or email) using two radio buttons (SMS or Email).
2. When initiating, the SMS radio button will be checked and the EditText for the contact/receiver is on android:inputType="phone"
3. If i click on the EMAIL radio button i would like the EditText to be changed to android:inputType="textEmailAddress"
how can i do this from the MainActivity.java?
As the others have said the function to change the input type would be the setInputType function, how you could use it would be a couple of ways.
Create a button listener from the code.
OR use the onClick option in your element. <– How I would do it personally and shown below
I.E.
then in your main activity