标签:
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); }
标签:
原文地址:http://www.cnblogs.com/xbx2015/p/4530644.html