How to create multiple layouts and menu items in your Android App? - Switch layouts and exit menu

preview_player
Показать описание
In this video it shows how one can create multiple layouts in their Android App and switch between them easily by using setContentView command.

Further, it shows how one can create menu items for their Android App and switch between different layouts using the menu options selection. Exit option in the menu is shown which can be used to exit the App using the finish() API.

I hope you liked this video. For any questions, suggestions or appreciations, please reach out to us at:

For complete source code of this project please refer to the below link:

The Java code of this App is available below:

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
}

public void homelayoutButton(View view){
}

public void secondlayoutButton(View view){
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();

}

@Override

break;
break;
finish();
}

}
}

/************/
Рекомендации по теме
Комментарии
Автор

Hi, thank you for your tutorial, just a question, when you change the content view is it opening the second layout over the main layout or actually is finishing the main layout and then open the second layout?

johnjohnny
Автор

Thank You So Much This Really Helped Me

luckynhlonipho
Автор

can you give me online accident management system in android and webpage please!!!

eyutad