Skip to content

Instantly share code, notes, and snippets.

@kiwiandroiddev
Created July 4, 2017 05:53
Show Gist options
  • Select an option

  • Save kiwiandroiddev/a035a7f5639831168f0a1b0d15335761 to your computer and use it in GitHub Desktop.

Select an option

Save kiwiandroiddev/a035a7f5639831168f0a1b0d15335761 to your computer and use it in GitHub Desktop.
First cut of Main activity code for Distraction-free reading sample app Part 1
public class MainActivity extends AppCompatActivity {
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setupToolbar();
}
private void setupToolbar() {
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowTitleEnabled(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment