Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果您单击菜单上的一个按钮,它会打开一个 XML 首选项窗口,但我只想让该按钮调用另一个在我的 sqlite 数据库中创建记录的方法。
你为什么不直接在 onCreateOptionsMenu() 中调用这个方法并且不要膨胀菜单。
@Override public boolean onCreateOptionsMenu(Menu menu) { createRecord(); return false; }