I am trying to set text on a home screen widget.
i am using remoteView to archive this, but it does not show the text when i run the application.
The text needs to be set on a TextView (labelled ‘Update”)
public class MyWidgetProvider extends AppWidgetProvider
{
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)
{
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_layout);
views.setTextViewText(R.id.update, "Hellow");
}
}
try below code.
you have to make a one xml file
it will print the text in widget