I have two parts of codes. One has the error, but the other doesn't.
ActionBar theActionBar = getSupportActionBar();
if (theActionBar != null) {
// error: non-static method cannot be referenced from a static context
ActionBar.setDisplayHomeAsUpEnabled(true);
}
.
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
.
Does anyone happen to know how to explain this?