Skip to content
Advertisement

How to customize setError message in Android Studio with Java

I have several error messages in an Android Studio app using Java and I cannot figure out how to customize their appearance. I have consulted several answers on this site but none of them have worked for what I want.

This is what the error message looks like.

Error message.

I want to change the colors of the black background, the white text, and the red line and icon.

This is the code for the error message,

JavaScript

and this is the code for the editText object.

JavaScript

How do I change the colors displayed in the error message? Also, is there a way to set these color changes for the whole app and not just individually?

Thank you!

Advertisement

Answer

After googling little bit I found some answers for you. Here I am implementing those sites.

  1. devdeeds git repo
  2. findnerd
  3. xspdf

I am implementing that source code which looks like good for me

It is easy way to change color. If you have idea of html than you might see here you are just changing color by html format.

JavaScript

Following source code used in java

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement