Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Instead of using two layouts use a single layout as bellow</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;LinearLayout android:id="@+id/MyLayoutOne" android:layout_width="fill_parent" android:visibility="gone" android:layout_height="fill_parent" &gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Hi This is my first layout" /&gt; &lt;!-- Your first layout contents add here--&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/MyLayoutTwo" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Hi This is my Second layout" /&gt; &lt;!-- Your second layout contents add here --&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>Add your first layout contents inside MyLayoutOne and second layout contents inside MyLayoutTwo</p> <p>And use following codes inside your activity,</p> <pre><code>public class MainActivity extends Activity { LinearLayout MyLayoutOne; LinearLayout MyLayoutTwo; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); MyLayoutOne=(LinearLayout)findViewById(R.id.MyLayoutOne); MyLayoutTwo=(LinearLayout)findViewById(R.id.MyLayoutTwo); // this will make first layout visible MyLayoutOne.setVisibility(View.VISIBLE); // this will make second layout hidden from your layout MyLayoutTwo.setVisibility(View.GONE); //========================================= //in your post create add this codes //========================================= // this will make first layout hidden MyLayoutOne.setVisibility(View.GONE); // this will make second layout visible in your layout MyLayoutTwo.setVisibility(View.VISIBLE); //========================================= } } </code></pre> <p>This is a simplest method you must study fragments for better UI management. You can use viewflipper also.</p> <p>So Study Fragments and Viewflipper..</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload