今天需要给一个控件添加弹出菜单功能.就顺便学习了下popupMenu的使用,记录下来. 它的使用其实也非常的简单,看如下代码 popupMenu = new PopupMenu(MainActivity.this, eText); popupMenu.getMenuInflater().inflate(R.menu.main,popupMenu.getMenu()); Menu menu = popupMenu.getMenu(); menu.findItem(R.id.search).setV…
软件盘的监听事件,如下 private final OnKeyListener mSubjectKeyListener = new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (event.getAction() != KeyEvent.ACTION_DOWN) { return false; } // When the subject editor is e…