码迷,mamicode.com
首页 > 移动开发 > 详细

android:onClick事件

时间:2015-05-26 16:02:41      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:

android:onClick事件用户捕获用户的点击,在Activity里面实现点击的处理逻辑。

    <Button
        android:text="@string/hello_world"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:onClick="sendMessage"/>
    public void sendMessage(View view)
    {
        // Create the text view
        TextView textView = new TextView(this);
        textView.setTextSize(40);
        textView.setText("ok");

        // Set the text view as the activity layout
        setContentView(textView);

    }

 

android:onClick事件

标签:

原文地址:http://www.cnblogs.com/xbx2015/p/4530644.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!