views:

30

answers:

2

Anyone knows how to build errors like that shown in Androffice screenshots on AppBrain (http://www.appbrain.com/app/android.androffice)?

I think that I saw errors like that before. Is that built in Android SDK?

alt text

A: 

I don't believe it's a built-in thing for Android, but you should be able to get the basics by adding an android:drawableRight to your EditText, to show a warning icon.

It's hard to tell from the screenshow how that error then appears. Is it when the user clicks on the icon, or when the error happens it appears briefly like a toast?

So it's possible that adding a customised Toast could be useful here too.

Edit:
It seems that a PopupWindow would be a better fit, in comparison to a Toast.

Also, you can always run Androffice on your device, then run hierarchyviewer to inspect exactly how they are building the UI.

Christopher
+1  A: 

I've found it out that I can call mEditField.setError("Error message for field"); on field.

And... yes mechanism is build into Android. For sure it's available from Android API v1.

croogie