launch the app on widgets Month click

This commit is contained in:
tibbi 2016-06-03 20:52:46 +02:00
parent bf047fd4dc
commit a14f6d3f83
1 changed files with 7 additions and 0 deletions

View File

@ -80,9 +80,16 @@ public class MyWidgetProvider extends AppWidgetProvider implements Calendar {
remoteViews.setOnClickPendingIntent(id, pendingIntent); 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 setupButtons() { private void setupButtons() {
setupIntent(PREV, R.id.left_arrow); setupIntent(PREV, R.id.left_arrow);
setupIntent(NEXT, R.id.right_arrow); setupIntent(NEXT, R.id.right_arrow);
setupAppOpenIntent(R.id.table_month);
} }
private SharedPreferences initPrefs(Context context) { private SharedPreferences initPrefs(Context context) {