XML : Displaying text using textView() Android

Unsure of how to display text in the xml file, i have code written to output text in the java file but nothing happens when the application is run

  TextView tv = (TextView) findViewById(R.id.my_text_view);  tv.setText("Welcome to the Dungeon");    

*

  <TextView  android:layout_width="wrap_content"  android:layout_height="wrap_content"  android:id="@+id/my_text_view"  android:text="@string/my_text_view"/>    

No comments:

Post a Comment