inf*_*nfo 94 android click button android-intent
我需要点击意图ACTION_SEND的按钮.这里不需要显示UI.我可以从Android中的MMS-SMSProvider点击"发送"按钮吗?
Pet*_*teH 42
如果您的按钮包含任何动画,则需要执行单击,然后在performClick后使每个步骤无效.这是如何做:
button.performClick();
button.setPressed(true);
button.invalidate();
button.setPressed(false);
button.invalidate();
Run Code Online (Sandbox Code Playgroud)
有时我也不得不引入延迟来播放动画.像这样:
//initiate the button
button.performClick();
button.setPressed(true);
button.invalidate();
// delay completion till animation completes
button.postDelayed(new Runnable() { //delay button
public void run() {
button.setPressed(false);
button.invalidate();
//any other associated action
}
}, 800); // .8secs delay time
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
64062 次 |
| 最近记录: |