I want to create a toast message with background color is white and message color is black. My toast message is:
Toast.makeText(Logpage.this, \"Please Give
Adding to @AndroidKiller's answer, you can also set the gravity and a custom TextView among other things like so:
Toast toast = Toast.makeText(context, context.getResources().getString(resID), Toast.LENGTH_LONG);
LayoutInflater li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE );
View toastView = li.inflate(R.layout.toast_hint_layout, null);
TextView text = (TextView) toastView.findViewById(R.id.hint_text_tv);
text.setText(resID);
toast.setView(toastView);
toast.setDuration(Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toastView.setBackgroundResource(R.drawable.toast_9_patch);
toast.show();
Note, your background drawable should be a nine-patch PNG
You can even put an ImageView, and multiple TextViews in with XML like this: