android - Set contentDescription for a custom dialog -


how can set contentdescription read accessibility service when dialog opened? i'm using dialog custom layout display blocking laoding screen , spoken contentdescription "alert", not appropriate in circumstance.

thanks ;)

you can create subclass dialog , override dispatchpopulateaccessibilityevent provide own accessibility text.

here's example:

@override public boolean dispatchpopulateaccessibilityevent(accessibilityevent event) {     if (event.geteventtype() == accessibilityevent.type_window_state_changed) {         event.gettext().add("your message goes here");         return true;     }     return super.dispatchpopulateaccessibilityevent(event); } 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -