android layout with visibility GONE android layout with visibility GONE android android

android layout with visibility GONE


<TextView                android:id="@+id/layone"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="Previous Page"                android:textColor="#000000"                android:textSize="16dp"                android:paddingLeft="10dp"                android:layout_marginTop="10dp"                android:visibility="gone" />

layone is a TextView.
You got your id wrong.

LinearLayout layone= (LinearLayout) view.findViewById(R.id.laytwo);// change id herelayone.setVisibility(View.VISIBLE);

should do the job.

or change like this to show the TextView:

TextView layone= (TextView) view.findViewById(R.id.layone);    layone.setVisibility(View.VISIBLE);


Done by having it like that:

view = inflater.inflate(R.layout.entry_detail, container, false);TextView tp1= (TextView) view.findViewById(R.id.tp1);LinearLayout layone= (LinearLayout) view.findViewById(R.id.layone);tp1.setVisibility(View.VISIBLE);layone.setVisibility(View.VISIBLE);


<LinearLayout    android:layout_width="match_parent"    android:layout_height="wrap_content"    android:layout_below="@+id/activity_register_header"    android:minHeight="50dp"    android:orientation="vertical"    android:visibility="gone" />

Try this piece of code..For me this code worked..