If you click a button on the menu it opens up an XML preference window, but I just want the button to call another method that creates开发者_运维百科 a record in my sqlite database.
Why don't you just call this method in onCreateOptionsMenu() and do not inflate menu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
createRecord();
return false;
}
精彩评论