android - Multiple textviews are not shown in Linear layout -


i try develop small android app , use fragments tab feature. here tab3's layout:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:background="#ff0000"     android:orientation="vertical" >       <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="@string/european_central_bank" />      <textview         android:id="@+id/textview1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="türk lirası: " />      <textview         android:id="@+id/textview2"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="dolar:" />      <textview         android:id="@+id/textview3"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="japon yeni:" />  </linearlayout> 

and java part:

public class tab3fragment extends fragment {     private string turkishlira;     private string dollar;     private string japanesemoney;     url url;      public view oncreateview(layoutinflater inflater, viewgroup container,             bundle savedinstancestate) {          view mycreateview=(linearlayout)inflater.inflate(r.layout.tab_frag3_layout, container, false);          getcurrencyinfo();           textview textview1 = (textview) mycreateview.findviewbyid(r.id.textview1);         textview textview2 = (textview) mycreateview.findviewbyid(r.id.textview2);         textview textview3 = (textview) mycreateview.findviewbyid(r.id.textview3);         textview1.settext(turkishlira);         textview2.settext(dollar);         textview3.settext(japanesemoney);           return mycreateview;     }      getcurrencyinfo() {...} } 

the question first textview shown on phone. if swap 1st , 2nd textview, time 2nd textview has static content shown. missing? don't have problem in getcurrencyinfo method, printed it's results. thanks, in advance.

my guess turkishlira, dollar, or japanesemoney might null or empty.

have debugged getcurrencyinfo() method?

you should maybe try

textview1.settext("turkishlira"); textview2.settext("dollar"); textview3.settext("japanesemoney"); 

this let check wether layout issue or getcurrencyinfo() issue.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -