update the widgets properly
This commit is contained in:
parent
7cace2b5bc
commit
e19a02c017
|
@ -51,13 +51,17 @@ public class MyWidgetProvider extends AppWidgetProvider implements MyCamera {
|
||||||
@Override
|
@Override
|
||||||
public void enableFlashlight() {
|
public void enableFlashlight() {
|
||||||
remoteViews.setImageViewResource(R.id.toggle_btn, R.mipmap.flashlight_big_on);
|
remoteViews.setImageViewResource(R.id.toggle_btn, R.mipmap.flashlight_big_on);
|
||||||
widgetManager.updateAppWidget(widgetIds, remoteViews);
|
for (int widgetId : widgetIds) {
|
||||||
|
widgetManager.updateAppWidget(widgetId, remoteViews);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disableFlashlight() {
|
public void disableFlashlight() {
|
||||||
remoteViews.setImageViewResource(R.id.toggle_btn, R.mipmap.flashlight_big_off);
|
remoteViews.setImageViewResource(R.id.toggle_btn, R.mipmap.flashlight_big_off);
|
||||||
widgetManager.updateAppWidget(widgetIds, remoteViews);
|
for (int widgetId : widgetIds) {
|
||||||
|
widgetManager.updateAppWidget(widgetId, remoteViews);
|
||||||
|
}
|
||||||
cameraImpl.releaseCamera();
|
cameraImpl.releaseCamera();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue