Answers for "a textview is defined in activity_main.xml and given the id tv. inside mainactivity.java, write the code to retrieve that textview and change its text to changed."

0

android java change text value

A text:
TextView myText= (TextView) findViewById(R.id.textview);
       myText.setText("Example of Text");
An image:
ImageView image = (ImageView)  findViewById(R.id.imageid);
       image.setImageResource(R.drawable.imageid2);
Posted by: Guest on January-05-2021

Code answers related to "a textview is defined in activity_main.xml and given the id tv. inside mainactivity.java, write the code to retrieve that textview and change its text to changed."

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language