ANDRIOD事件响应--
来源:互联网 发布:java 的io重要吗 编辑:程序博客网 时间:2024/06/05 01:07
1.滑动/触摸事件响应
Button.OnTouchListenter(New OntouchListener)(){
@override
public boolean OnTouch(View v,MotionEvent event) {
int actionType=event.getAction;
if(actionType==MotionEvent.ACTION_DOWN){
sout(1);
}else{
sout(2);
}
}
//元事件 action_down /up /move
}
2.焦点事件(改变)
Button.OnFocusListenter(New OnFocusListenter)(){
@override
public boolean OnFocusChange(View v,boolean event) {
sout(3);
}
//元事件 action_down /up /move
}
3.长按事件
Button.OnLongClickListenter(New OnLongClickListenter)(){
@override
public boolean OnLongClick(View v) {
sout(3);
return true;//flase。如为true则消耗掉该事件,不下传。
}
}
4.键盘事件
Button.OnKeyListenter(New OnKeyListenter)(){
@override
public boolean OnKey(View v,int keyCode,KeyEvent event) {
sout(3);
return true;//flase。如为true则消耗掉该事件,不下传。
}
}
Button.OnTouchListenter(New OntouchListener)(){
@override
public boolean OnTouch(View v,MotionEvent event) {
int actionType=event.getAction;
if(actionType==MotionEvent.ACTION_DOWN){
sout(1);
}else{
sout(2);
}
}
//元事件 action_down /up /move
}
2.焦点事件(改变)
Button.OnFocusListenter(New OnFocusListenter)(){
@override
public boolean OnFocusChange(View v,boolean event) {
sout(3);
}
//元事件 action_down /up /move
}
3.长按事件
Button.OnLongClickListenter(New OnLongClickListenter)(){
@override
public boolean OnLongClick(View v) {
sout(3);
return true;//flase。如为true则消耗掉该事件,不下传。
}
}
4.键盘事件
Button.OnKeyListenter(New OnKeyListenter)(){
@override
public boolean OnKey(View v,int keyCode,KeyEvent event) {
sout(3);
return true;//flase。如为true则消耗掉该事件,不下传。
}
}
阅读全文
0 0
- ANDRIOD事件响应--
- Andriod UI 事件监听
- Andriod UI 事件监听
- 事件响应
- 事件响应
- Andriod Contact联系人点击事件
- andriod事件处理流程解析
- Andriod Touch事件分发详解
- andriod 按钮事件 与 进度条事件
- Datagrid事件响应(二)
- ItemCommand事件不响应
- 响应按钮的事件
- DirectShow中响应事件
- winform响应回车事件
- 禁止响应事件函数
- ItemCommand事件不响应
- DirectShow中响应事件
- Swing事件响应机制
- 面向对象 内存
- spring mvc异常统一处理(ControllerAdvice注解)
- HttpClient无法使用
- 无法转换为内部表示解决办法
- WebLogic使用总结(一)——WebLogic安装
- ANDRIOD事件响应--
- 云领未来
- 通过URL下载文件
- Shell编程中select用法
- mysql建表出现Error Code : 1005;Can't create table 'table' (errno: 121)
- Java进程CPU使用率高排查
- POJ
- c++解析自定义格式字符串
- python 虚拟环境