Main activity layout code from sample app