 <p>Your question seems unclear, but I suppose that you are asking how to load another layout/activity/fragment by clicking on a button.</p> <p>Well, it depends on which of the three actions you want to do:</p> <p>1) in order to load another layout, you need to inflate the new layout in your view; in order to do that you need to clear the actual layout and inflate the new one. Here's some sample code:</p> <pre><code>//you may change it to whichever layout you used LinearLayout ll = (LinearLayout) findViewById(R.id.mainLayout); //remove previous view ll.removeAllViews(); //set the new view setContentView(R.layout.new_layout); </code></pre> <p>2) in case you want to start a new activity, you need to use a Intent and load it. Sample code:</p> <pre><code>//create the new intent; it will refer to the new activity Intent intent = new Intent(this, NewActivity.class); //pass any data to the new activity; cancel this line if you don't need it intent.putExtra(extra_title, extra) //start the new activity startActivity(intent); </code></pre> <p>3) in case you want to change fragment, you need to perform a transaction. Sample code:</p> <pre><code>//create the new fragment Fragment newFragment = new MyFragment(); //start a fragment transaction FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); //replace the old fragment with the new transaction.replace(R.id.frame, newFragment).commit(); </code></pre> <p>Hope this helps; if not, try to edit your question in order to clarify what you mean.</p> <hr> <p><strong>EDIT:</strong></p> <p>You should add a new OnClickListener to each button, but I would do it differently than you are doing right now. I would do something like this sample code:</p> <pre><code>buttonWRGL.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(this, NewActivity1.class); startActivity(intent); } }); </code></pre> <p>For each button. In this code, I directly attach a specific OnClickListener to the button; it will contain the intent that you need. You can copy this in every button, even 10k buttons, you just need to change the activity name inside the intent declaration with the activity that you want to launch.</p>