工作示例code代表button.performClick() [英] Working sample code for button.performClick()

查看:193
本文介绍了工作示例code代表button.performClick()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以把一个工作code例如 button.performClick()分配到 OnClickListener 。下面code,我已经使用返回false对 button.performClick() -

  myButton.performClick()
 myButton.setOnClickListener(新View.OnClickListener()
      {
           @覆盖
           公共无效的onClick(查看视图)
           {
              .............
           }
});


解决方案

  button.performClick()

myButton.performClick(); ,那么你应该在注册 OnClickListener 为后Exec的它的则myButton

  myButton.setOnClickListener(新View.OnClickListener()
      {
           @覆盖
           公共无效的onClick(查看视图)
           {
              .............
           }
});
myButton.performClick();

Can someone please put a working code example of button.performClick() assigned to a OnClickListener. The following code which I have used returns false for button.performClick()-

myButton.performClick()
 myButton.setOnClickListener ( new View.OnClickListener()
      {
           @Override
           public void onClick ( View view )
           {
              .............
           }
});

解决方案

button.performClick()

should be myButton.performClick(); then you should exec it after you register the OnClickListener for your myButton

myButton.setOnClickListener ( new View.OnClickListener()
      {
           @Override
           public void onClick ( View view )
           {
              .............
           }
});


myButton.performClick();

这篇关于工作示例code代表button.performClick()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆