我可以使用下面的代码使它不可见,但是不能禁用它。
RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.notification);
contentView.setViewVisibility(R.id.buttonToDisable, View.INVISIBLE);
Run Code Online (Sandbox Code Playgroud)
setEnabled()是@RemotableViewMethod,至少在源代码的当前master分支上。因此,您应该可以使用setBoolean():
contentView.setBoolean(R.id.buttonToDisable, "setEnabled", false);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
741 次 |
| 最近记录: |