How can i change default toast message color and background color in android? -
i want create toast message background color white , message color black.
how can create it?
my toast message is:
toast.maketext(logpage.this, "please give feedback...", 3000).show();
i wanted create in method not in oncreate().
you can create custom toast message below :
toast toast = new toast(context); toast.setduration(toast.length_long); layoutinflater inflater = (layoutinflater) context.getsystemservice(context.layout_inflater_service); view view = inflater.inflate(r.layout.your_custom_layout, null); toast.setview(view); toast.show();
one textview can put inside layout file , give background , textcolor want.
also can following won't need custom layout file :
toast toast = toast.maketext(context, r.string.string_message_id, toast.length_long); view view = toast.getview(); view.setbackgroundresource(r.drawable.custom_backgrround); textview text = (textview) view.findviewbyid(android.r.id.message); /*here can above textview text.settextcolor(color.parsecolor("#000000"));*/ toast.show();
Comments
Post a Comment