Android studio编程中的使用小技巧

1. 快速生成onClick()点击方法

<Button
   android:id="@+id/btn_toWebView"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:layout_weight="1"
   android:onClick="myOnclick"
   android:text="@string/activity_webView_btn_useJs" /> 

一定要将鼠标先点击myOnclick, 按提示快捷键Alt+Enter:
这里写图片描述
接下来大家就看的懂英文什么意思,直接点击第一个选项,就可以在你对应的activity中新建:

01.public void Onclick(View view) {  
02.         
03.   }  

猜你喜欢

转载自blog.csdn.net/openbug/article/details/79320323