2013年2月28日
摘要: public void menuItem_exit_onClick(MenuItem item){ AlertDialog builder = new AlertDialog.Builder(LoginActivity.this).create(); builder.setTitle("Title"); builder.setMessage("Message"); builder.show(); } 阅读全文
posted @ 2013-02-28 16:20 BadTree 阅读(441) 评论(0) 推荐(0) 编辑
摘要: Android開發onClick事件在Android开发中,很多时都会用到onClick事件,网上或者官方都有很多的例子说明,但大多都是在Activity中的onCreate事件中声明定义,我觉得这样的做法,使得onCreate事件越来越臃肿,并且在查看Layout文件时,并不直观。故我推荐的的做法是在Layout的控件定义中声明onClick事件:界面代码: Activity代码: public void menuItem_exit_onClick(MenuItem item){ //Exit Program android.os.Process.ki... 阅读全文
posted @ 2013-02-28 16:18 BadTree 阅读(502) 评论(0) 推荐(0) 编辑