( Toolbar ) findViewById( R.id.tool_bar ) return NULL
My Android Studio, for some reason, started to default to a CustomView that would not allow me to edit the layout. It starts up with with a theme that includes a toolbar and mail icon in the bottom right. mainAcitivty.java is then looking for that toolbar and fab, which is no longer there.
in mainAcitivty.java REPLACE:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}
WITH this
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}