Couldn't expand RemoteViews

You cannot put an EditText into a RemoteViews. RemoteViews is limited to a handful of possible widgets, specifically those documented for use on an app widget. And, for a Notification, I doubt that the AdapterView options, like ListView, will work either.


Not all views can be used in RemoteViews. A RemoteViews object can support the following layout classes:

FrameLayout

LinearLayout

RelativeLayout

GridLayout

AnalogClock

Button

Chronometer

ImageButton

ImageView

ProgressBar

TextView

ViewFlipper

ListView

GridView

StackView

AdapterViewFlipper

You can't use other layout classes like EditText or CustomViews.


For me, it was because I was setting the text inside the remoteViews TextViews incorrectly. I was doing this:

remoteViews.setString(R.id.txt, "setText", "text");

Using one of these methods solved it for me:

remoteViews.setCharSequence(R.id.txt, "setText", "text");
//Or simply:
remoteViews.setTextViewText(R.id.txt, "text");