Wednesday, July 20, 2011

[android-developers] TextView in TabHost

Hi all!
I have class MyTabHost extends TabActivity and there is a method
public static View getTextView(Context c) {
View view = LayoutInflater.from(c).inflate(R.layout.tabhost_new,
null);
TextView amount = (TextView) view.findViewById(R.id.amount2);
return amount;

}
.xml

<?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:orientation="vertical">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/imageView1"
android:layout_gravity="center" />
<TextView
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:id="@+id/amount2" />
</FrameLayout>
<TextView
android:layout_height="wrap_content"
android:text="TextView"
android:gravity="center"
android:textSize="10dip"
android:layout_width="fill_parent"
android:id="@+id/textView2" />
</LinearLayout>
I need to change text in TextView (android:id="@+id/amount2") after
clicking on button "Add" in one of my 4 Activities.But this method
(public static View getTextView(Context c) doesn't give the
possibility to change the text. What's wrong? Can anyone help me?
Thank you in advance!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment