mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-28 09:29:25 +01:00
small context handling change in widget
This commit is contained in:
parent
997c41b72e
commit
9550545181
@ -38,13 +38,13 @@ public class MyWidgetProvider extends AppWidgetProvider implements Calendar {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
|
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
|
||||||
cxt = context;
|
initVariables(context);
|
||||||
initVariables();
|
|
||||||
updateWidget();
|
updateWidget();
|
||||||
super.onUpdate(context, appWidgetManager, appWidgetIds);
|
super.onUpdate(context, appWidgetManager, appWidgetIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initVariables() {
|
private void initVariables(Context context) {
|
||||||
|
cxt = context;
|
||||||
res = cxt.getResources();
|
res = cxt.getResources();
|
||||||
|
|
||||||
final SharedPreferences prefs = initPrefs(cxt);
|
final SharedPreferences prefs = initPrefs(cxt);
|
||||||
@ -91,9 +91,8 @@ public class MyWidgetProvider extends AppWidgetProvider implements Calendar {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
cxt = context;
|
if (remoteViews == null || widgetManager == null || calendar == null || cxt == null)
|
||||||
if (remoteViews == null || widgetManager == null || calendar == null)
|
initVariables(context);
|
||||||
initVariables();
|
|
||||||
|
|
||||||
final String action = intent.getAction();
|
final String action = intent.getAction();
|
||||||
switch (action) {
|
switch (action) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user