首页 > 移动平台 > 详细

android:onClick事件

时间:2015-05-26 15:59:59      阅读:281      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!