tags:

views:

43

answers:

1

I'm new to Android development, and I'm trying to write a small widget. This code works on the emulator and the text is set to "test", but when i run it on my Nexus One it doesn't. It just appear like onUpdate isn't called. Anyone have any good idea what i'm doing wrong?

public class HelloWidget extends AppWidgetProvider 
{       
    @Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) 
    {
        final int N = appWidgetIds.length;

        for (int i=0; i<N; i++) 
        {
            int appWidgetId = appWidgetIds[i];

            String myLine = "test";
            RemoteViews remoteViews;
            remoteViews = new RemoteViews(context.getPackageName(), R.layout.main);

            remoteViews.setTextViewText(R.id.widget_textview, myLine);
            appWidgetManager.updateAppWidget(appWidgetId, remoteViews); 
        }
    }
}
A: 

Never mind this question, don't really know what I did but it started working..

Johan B