Trouble with TextView Class

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Trouble with TextView Class

Postby simpson_121919 » Tue Jul 09, 2013 6:01 pm

I can not seem to dynamical put variables on my app. text screen. Within my activity_main.xml file I have created an id like this -

Code: Select all
<TextView
         android:id="@+id/dataView1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_above="@+id/textView2"
         android:layout_marginLeft="36dp"
         android:layout_toRightOf="@+id/textView5"
         android:text="@string/planet_name_label" />



I am trying to display "dataView1" within my MainActivity.java file like this -

Code: Select all
TextView planetNameValue (TextView)findViewById(R.id.dataView1); 
        planetNameValue.setText(earth.planetName);


Everything complies but my dataView1 does not show up on app screen.
Thanks in advance.
simpson_121919
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Jul 09, 2013 5:57 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests