/** Called when the user clicks the Send button */
public void sendMessage(View view) {
// Do something in response to button
}

In order for the system to match this method to the method name given toandroid:onClick, the signature must be exactly as shown. Specifically, the method must:

  • Be public //一定是public的方法
  • Have a void return value //一定是无返回值的方法
  • Have aViewas the only parameter (this will be theViewthat was clicked) //有且只有一个View类型的形参(希望被点到的View)

更多相关文章

  1. canvas.drawRoundRect方法,绘制圆角矩形
  2. android抓log方法
  3. android 登陆右上角 的关闭按钮的使用方法
  4. Android AESUtils 工具类与调用方法
  5. Android Gson类型转换错误解决 com.google.gson.internal.Linked
  6. sqlit导入外部数据库查找数据方法
  7. Android NDK打印log到logcat的方法
  8. Android获取系统时间的多种方法
  9. Android链式方法显示Dialog

随机推荐

  1. android调用系统(相机)的图片,并且返回
  2. Android监听未接来电
  3. android调用浏览器打开网页链接
  4. Eclipse配置Android开发环境
  5. Android Failed to allocate memory: 145
  6. android 打开各种文件的方式
  7. MediaExtractor的seekTo方法精确定位到指
  8. Android 手写和笔锋研究资料
  9. 安卓学习之--UI控件用法 单选 按钮 下拉
  10. android 修改系统显示u盘的名称