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);