I have read everything i could find from developer.android.com and
other sites that I found. I have successfully created a widget however
I must not fully understand how they work because when i try to set
text from a java file rather than the xml layout it acts funny.
Sometimes it works and sometimes it doesn't even if I dont change the
code at all.

Any Help would be greatly appreciated. I've been racking my brain
overthis for a while now.

This is what I have.


--------------------------------------------------------------------------------------------------------------------------
package sch.jake.widgeTtest;

import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.widget.RemoteViews;


public class wigettest extends AppWidgetProvider{
        RemoteViews views;

         public void onUpdate(Context awc, AppWidgetManager awm, int[] awi){
                 int numWidgets = awi.length;
                 for(int i = 0; i < numWidgets; i++){
                         int appWidgetId = awi[i];

                        // Get the layout for the App Widget and attach an 
on-click
listener to the button
                    views = new RemoteViews(awc.getPackageName(),
R.layout.main);
                    views.setTextViewText(R.id.timetext, "If you see this it
works");

                 // Tell the AppWidgetManager to perform an update on the
current App Widget
                    awm.updateAppWidget(appWidgetId, views);





                 }
         }



}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to