EDIT: The latest version of support library (23.0.1) fixes this issue.
Fixed an issue where hardware buttons did not work when an activity
had set the Toolbar class to act as the ActionBar by using the
setSupportActionBar() method. (Issue 183334)
I have the exact same problem, but I cannot post a comment so commenting as an answer.
Some code for reference:
public class ActivitySettings extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
@Override
public void onBackPressed() {
super.onBackPressed();
Log.e("test","onBackPressed");
}
If I just remove these 2 lines, the onBackPressed gets called
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
This problem occurs only in android 2.3.x. Anything above that works fine.