How to connect multiple xml files <p>My app needs different screens and each screen should be connected with each other. For example there are 5 screens, the main screen, 4 other screens connected to the main screen. The main screen contains 4 buttons to goto other screens and the other screens has a button to go back to the main screen. The problem is i cant get the ids of other screens. And do i need to create 4 .java files for the new screens?</p> <p>This is the code for connecting main screen to others:</p> <pre><code>LayoutInflater inflater; View one; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.total_assets); inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); one = inflater.inflate(R.layout.total_assets,null); Button home = (Button) findViewById(R.id.goback); home.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub setContentView(R.layout.activity_acc_soft); } }); </code></pre> <p>total_assets is the second screen and actinity_acc_soft is the main screen.</p> <p>(plz help newbie to android)</p>