diff --git a/app/src/main/java/com/simplemobiletools/calculator/MyWidgetProvider.java b/app/src/main/java/com/simplemobiletools/calculator/MyWidgetProvider.java index 762b658f..b00f06ab 100644 --- a/app/src/main/java/com/simplemobiletools/calculator/MyWidgetProvider.java +++ b/app/src/main/java/com/simplemobiletools/calculator/MyWidgetProvider.java @@ -48,6 +48,9 @@ public class MyWidgetProvider extends AppWidgetProvider implements Calculator { setupIntent(Constants.CLEAR, R.id.btn_clear); setupIntent(Constants.RESET, R.id.btn_reset); + setupAppOpenIntent(R.id.formula); + setupAppOpenIntent(R.id.result); + updateWidget(); super.onUpdate(context, appWidgetManager, appWidgetIds); } @@ -58,6 +61,12 @@ public class MyWidgetProvider extends AppWidgetProvider implements Calculator { remoteViews.setOnClickPendingIntent(id, pendingIntent); } + private void setupAppOpenIntent(int id) { + final Intent intent = new Intent(cxt, MainActivity.class); + final PendingIntent pendingIntent = PendingIntent.getActivity(cxt, 0, intent, 0); + remoteViews.setOnClickPendingIntent(id, pendingIntent); + } + private void initVariables(Context context) { cxt = context; updateWidgetIds();