/** 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. 浅谈Java中Collections.sort对List排序的两种方法
  2. Python list sort方法的具体使用
  3. python list.sort()根据多个关键字排序的方法实现
  4. Android(安卓)IntentService 分析
  5. android mediaplayer SurfaceView
  6. android mediaplayer SurfaceView
  7. canvas.drawRoundRect方法,绘制圆角矩形
  8. android java.util.ConcurrentModificationException
  9. Android(安卓)View绘制机制

随机推荐

  1. Field requires API level 14 (current m
  2. [置顶] blog收藏目录
  3. Android(安卓)ViewPager Adapter 内存管
  4. android 中的PopupWindow 弹出菜单
  5. android官方技术文档翻译——aar 格式
  6. windows下搭建android NDK编译环境快速搭
  7. Android——按钮操作
  8. Android动画知识汇总
  9. Android按键事件——上层与驱动的映射
  10. Android(安卓)Drawable - Shape