1

I did alot of research to do the following:
I want to add a text view by code in the AppWidgetProvider class , but i couldnt do that because the addView method of RemoteViews require an id of the view that is already defined in the xml layout.

And i want to add textview's depending on the size of the widget so can i do that ?

Thanks in advance .

Nelson
  • 49,283
  • 8
  • 68
  • 81

1 Answers1

0

Yes you can check this Link its may help you.

or

TextView valueTV = new TextView(this);
valueTV.setText("hallo hallo");
valueTV.setId(5);
valueTV.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
Community
  • 1
  • 1
Rajesh Rajaram
  • 3,271
  • 4
  • 29
  • 48