Android - EditText on status notification

2019-02-10 01:12发布

问题:

Does anyone know if I can insert an EditText (for inserting text) on an Android notification? I would like to have a button and an edittext when the button is pressed then get back the text on the edittext.

It's possible? Thanks

回答1:

This can be done in Jelly Bean but as far as I know not in version prior to that. Since this is built in to the android system it should be considered and acceptable practice.

From the android blog:

Bi-directional text support: Android 4.1 helps you to reach more users through support for for bi-directional text in TextView and EditText elements.

Android blog post that mentions this capability

Here is were you can learn about "Creating a Custom Notification Layout"



回答2:

But it was good in case where you are using the pdf reader and at the same time you need to use a dictionary then its good to type a word into the textbox and will get its meaning instead of switching from one app to another.



回答3:

Is that good UI? I don't think people expect to write something on a notification. It'll confuse them. Why don't you just have a button that opens your app and lets the user type?