Android Studio: simpleTextView

From OnnoCenterWiki
Revision as of 23:09, 10 April 2022 by Unknown user (talk) (Created page with " TextView code in XML: <TextView android:id="@+id/simpleTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="AbhiAndroid" />...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

TextView code in XML:

<TextView android:id="@+id/simpleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AbhiAndroid" />

TextView code in JAVA:

TextView textView = (TextView) findViewById(R.id.textView);
textView.setText("AbhiAndroid"); //set text for text view