Last Updated: July 11, 2019
· johnnylambada

use addContentView for app tutorials

One feature of Activities that I have never used since last week is addContentView(). It allows you to add a whole new layout complete with buttons, images, etc on top of your current view, much the same way that Photoshop allows you to create multiple layers. All of the controls on both views are available and will respond to user IO (although you can block the bottom layer).

Why would you want to do this? It's a fantastic mechanism for creating a tutorial for your application. You don't have to disturb your main UI logic, you just create a tutorial view on top of your main view and step the user through the main view using buttons and images that appear over it in the tutorial view.