|
|
@@ -1,13 +1,17 @@ |
|
|
package com.kroah.clock;
|
|
|
|
|
|
+import android.app.PendingIntent;
|
|
|
import android.appwidget.AppWidgetManager;
|
|
|
import android.appwidget.AppWidgetProvider;
|
|
|
import android.content.ComponentName;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
+import android.util.Log;
|
|
|
+import android.widget.RemoteViews;
|
|
|
|
|
|
public class MedAppWidget extends AppWidgetProvider {
|
|
|
-
|
|
|
+
|
|
|
+ public static final String MODULE = "GREGKHWidget";
|
|
|
|
|
|
@Override
|
|
|
public void onUpdate(Context context,
|
|
@@ -21,6 +25,23 @@ public void onUpdate(Context context, |
|
|
context.startService(new Intent(context, UpdateService.class));
|
|
|
}
|
|
|
|
|
|
+ public static RemoteViews buildUpdate(Context context) {
|
|
|
+
|
|
|
+ Log.d(MODULE, "building widget update");
|
|
|
+ RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_loading);
|
|
|
+
|
|
|
+// ContentResolver resolver = context.getContentResolver();
|
|
|
+// Resources res = context.getResources();
|
|
|
+// Cursor cursor = null;
|
|
|
+
|
|
|
+ // Tie clicking on the button to bring up our configure screen
|
|
|
+ Intent intent = new Intent(context, Configure.class);
|
|
|
+ PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
|
|
|
+ views.setOnClickPendingIntent(R.id.loading, pendingIntent);
|
|
|
+ return views;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// final int num_ids = appWidgetIds.length;
|
|
|
// for (int i = 0; i < num_ids; i++) {
|
|
|
//
|
|
@@ -32,10 +53,6 @@ public void onUpdate(Context context, |
|
|
// // Create a remote view
|
|
|
// RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_loading);
|
|
|
|
|
|
-// // Tie clicking on the button to bring up our configure screen
|
|
|
-// Intent intent = new Intent(context, Configure.class);
|
|
|
-// PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
|
|
|
-// views.setOnClickPendingIntent(R.id.loading, pendingIntent);
|
|
|
//
|
|
|
// // set the time
|
|
|
//// DateFormat format = SimpleDateFormat.getTimeInstance(SimpleDateFormat.MEDIUM, Locale.getDefault());
|
|
|
0 comments on commit
1374021