一。Android通过recycleView结合checkbox实现单选操作:
https://blog.csdn.net/qq1271396448/article/details/80539042
二。设置EditText没有光标的处理:
android:cursorVisible="true"
android:textCursorDrawable="@null"/>
即设置textCursorDrawable为@null,这样光标就默认显示字体的颜色,也可以设置一个自定义的drawable。
三。//关于WebView返回的操作
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (letouWeb.canGoBack()) {
letouWeb.goBack();
}else {
exitByDoubleClick();
}
}
return false;
}
//关于WebView返回的操作
private static BooleanisExit =false;
private void exitByDoubleClick() {
if (!isExit) {
isExit =true;
Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_LONG).show();
ScheduledExecutorService newScheduledThreadPool = Executors
.newScheduledThreadPool(1);
TimerTask task =new TimerTask() {
@Override
public void run() {
try {
isExit =false;//取消退出
}catch (Exception e) {
e.printStackTrace();
}
}
};
newScheduledThreadPool.schedule(task, 2000, TimeUnit.MILLISECONDS);
}else {
finish();
}
}
网友评论