Skip to content

Commit

Permalink
Home screen widget wasn't being refreshed
Browse files Browse the repository at this point in the history
  • Loading branch information
evilbunny2008 committed Jan 2, 2019
1 parent 113ba04 commit 576dbeb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.odiousapps.weewxweather"
minSdkVersion 19
targetSdkVersion 28
versionCode 8017
versionName "0.8.17"
versionCode 8018
versionName "0.8.18"
}
buildTypes {
release {
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/odiousapps/weewxweather/Common.java
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,13 @@ void SendRefresh()
intent.setAction(Common.REFRESH_INTENT);
context.sendBroadcast(intent);
Common.LogMessage("refresh_intent broadcast.");

intent = new Intent(context, WidgetProvider.class);
intent.setAction("android.appwidget.action.APPWIDGET_UPDATE");
int ids[] = AppWidgetManager.getInstance(context.getApplicationContext()).getAppWidgetIds(new ComponentName(context.getApplicationContext(), WidgetProvider.class));
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS,ids);
context.sendBroadcast(intent);
Common.LogMessage("widget intent broadcasted");
}

void getWeather()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public void run()
String oldcustom = common.GetStringPref("CUSTOM_URL", "");
String oldcustom_url = common.GetStringPref("custom_url", "");

String data = "", radtype = "", radar = "", forecast = "", webcam = "", custom = "", custom_url, fctype = "", bomtown = "", metierev = "";
String data = "", radtype = "", radar = "", forecast = "", webcam = "", custom = "", custom_url, fctype = "", bomtown = "", metierev;

Switch metric_forecasts = findViewById(R.id.metric_forecasts);
Switch show_indoor = findViewById(R.id.show_indoor);
Expand Down
Binary file added app/src/main/res/drawable/meteoinfo_ru.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 576dbeb

Please sign in to comment.