Java事件模型与Android事件模型的比较
2010-07-01 14:49:00 来源:WEB开发网核心提示:describe what is to be displayed in the screen. */ protected void onCreate(Bundle savedValues) { ... // Listen for button clicks. Button button = (Button)findVi
describe what is to be displayed in the screen. */ protected void
onCreate(Bundle savedValues) { ... // Listen for button clicks. Button button =
(Button)findViewById(R.id.corky); button.setOnClickListener(mCorkyListener); }
// Create an anonymous class to act as a button click listener. private
OnClickListener mCorkyListener = new OnClickListener() { public void
onClick(View v) { // To send a result, simply call setResult() before your //
activity is finished. setResult(RESULT_OK, "Corky!"); finish(); } };
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/liranke/archive/2009/10/29/4740844.aspx
更多精彩
赞助商链接