android - TextView not adding in fragment layouts -
i have master-detail activity fragments. seek add together textview
dynamically in detail fragment. it's not adding detail fragment layouts. layouts displayed properly.
fragment code:
@override public view oncreateview(layoutinflater inflater, viewgroup container,bundle savedinstancestate) { view rootview = inflater.inflate( r.layout.fragment_configuration_detail, container, false); relativelayout cdf_detail_part1=((relativelayout) rootview.findviewbyid( r.id.cdf_detail_part1)); log.i("config", "mitem1->"+mitem1); if (mitem1 != null) { textview name_text = (textview) cdf_detail_part1.findviewbyid( r.id.cdf_tv_name); name_text.settext(name); } homecoming rootview; }
my layout xml file:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:baselinealigned="false" android:orientation="horizontal" tools:context="com.x.y.configurations.configurationdetailfragment" > <relativelayout android:id="@+id/cdf_detail_part1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:background="#00ff00" > <textview android:id="@+id/cdf_tv_name" style="?android:attr/textappearancelarge" android:layout_width="match_parent" android:layout_height="match_parent" /> </relativelayout> <relativelayout android:id="@+id/cdf_detail_part2" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:background="#0000ff" > </relativelayout> </linearlayout>
android android-layout android-fragments
No comments:
Post a Comment