WEB开发网
开发学院手机开发Android 开发 Android 界面编程#6-键盘操作响应 阅读

Android 界面编程#6-键盘操作响应

 2010-08-23 01:39:00 来源:WEB开发网   
核心提示:// TODO Auto-generated method stubsuper.onKeyDown(keyCode, event);setTitle("you pressed key:" + String.valueOf(keyCode));return true;}@Overridepublic

// TODO Auto-generated method stub

super.onKeyDown(keyCode, event);

setTitle("you pressed key:" + String.valueOf(keyCode));

return true;

}

@Override

public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) {

// TODO Auto-generated method stub

super.onKeyMultiple(keyCode, repeatCount, event);

TextView tv = (TextView)this.findViewById(R.id.mainview);

tv.setText("you have press key:[" + String.valueOf(keyCode) + "] for:" + String.valueOf(repeatCount) + "Times!");

return true;

}

@Override

public boolean onKeyUp(int keyCode, KeyEvent event) {

// TODO Auto-generated method stub

super.onKeyUp(keyCode, event);

setTitle("you release key:" + String.valueOf(keyCode));

return true;

}

}

上一页  1 2 

Tags:Android 界面 编程

编辑录入:coldstar [复制链接] [打 印]
赞助商链接