recyclerview焦点
//防止焦点丢失 public boolean onKeyDown(int keyCode, KeyEvent event) { long current = System.currentTimeMillis(); boolean dispatch; if (current - tempTime < 150) { dispatch = true; } else { dispatch = super.onKeyDown(keyCode, event); tempTime = current; } return dispatch; } //recyclerview tv焦点跳转指定位置 @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) { if (recyclerView.getChildLayoutPosition(recyclerView.getChildAt(0)) == 0) { recyclerView.scrollToPosition(adapter.getItemCount() - 1); requestFocus(recyclerView, adapter.getItemCount() - 1); }