Mam przycisk wewnątrz widget Android, stwierdził tak:Nie można wyłączyć android.widget.Button
<Button android:id="@+id/newWorkBtnWidget"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/ts_on_repair"/>
Za każdym razem staram się włączyć lub wyłączyć ten przycisk poprzez RemoteViews pojawia się błąd android.widget.RemoteViews$ActionException: view: android.widget.Button can't use method with RemoteViews: setEnabled(boolean)
Mój kod:
RemoteViews remoteViews = new RemoteViews(context.getPackageName(),
R.layout.widget);
remoteViews.setInt(R.id.newWorkBtnWidget, "setBackgroundResource",
R.drawable.green_button);
remoteViews.setBoolean(R.id.newWorkBtnWidget,
"setEnabled", false);
Jak to naprawić?
Eh, co to jest, 'newWorkBtnWidget' lub' newWorkButtWidget'? – eightx2
Przepraszamy, powinien to być ten sam przycisk, naprawiony. W każdym razie nie jest to związane z problemem. – bvk256