How can I change the text of an Android button widget within code and not the XML file?
I had a button in my layout.xml that was defined as a View as in:
final View myButton = findViewById(R.id.button1);
I was not able to change the text on it until I also defined it as a button:
final View vButton = findViewById(R.id.button1);
final Button bButton = (Button) findViewById(R.id.button1);
When I needed to change the text, I used the bButton.setText("Some Text");
and when I wanted to alter the view, I used the vButton.
Worked great!