摘要:
// 按下返回键时,实现HOME键的效果public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { //模拟HOME效果 Intent intent = ... 阅读全文
摘要:
// 定义一个long型变量,用于判断两次点击的间隔private long exitTime;// 实现返回键的点击事件public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_... 阅读全文
摘要:
View myView = (View) findViewById(R.id...);// 获得组件的布局参数LayoutParams params = myView.getLayoutParams();// 这里比如要改变marginTop属性int newTopMargin = 100;para... 阅读全文