1

I have an appWidget which displays a text view, in which the text is set from another activity via RemoteViews. Now i need to use or get the text that is displayed in this widget. How can i do this?

String text = context.getText(R.id.widgetVerse).toString();

Gives me "false" lol! although that was a try...

By the way i need to send this string to another intent via putExtra.

Wesley
  • 1,808
  • 5
  • 31
  • 46
  • Similar problem.[1] [1]: http://stackoverflow.com/questions/9748161/how-can-get-text-of-textview-that-placed-on-a-widget-in-android-programming/9751614#9751614 – Mbt925 Mar 17 '12 at 16:26
  • possible duplicate of [get text of a TextView in android home widget (not in activity)?](http://stackoverflow.com/questions/11237217/get-text-of-a-textview-in-android-home-widget-not-in-activity) – Amir Latifi May 28 '15 at 01:21

1 Answers1

-2

Try this.

String text = ((TextView) findViewById(R.id.widgetVerse)).getText().toString() ;

Vinay
  • 2,395
  • 3
  • 30
  • 35