If you want to write a simple toast in your activity:
Toast.makeText(getApplicationContext(),"Hello",Toast.LENGTH_SHORT).show();
1.Showing TextView in Toast:---
TextView tv = new TextView(this);
tv.setText("Hello!");
tv.setTextSize(30);
tv.setTextColor(Color.RED);
tv.setBackgroundColor(Color.YELLOW);
2.Showing Image as Toast:--
ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.blonde);
Toast t = new Toast(this);
t.setView(iv);
t.setDuration(Toast.LENGTH_LONG);
t.show();
3.showing Layout as Toast:--
LayoutInflater li = getLayoutInflater();
View view = li.inflate(R.layout.my_toast_layout,null,false);
Toast t = new Toast(this);
t.setView(view);
t.setDuration(Toast.LENGTH_LONG);
t.show();
** If you want to write the toast in your Async then:
private Activity activity;
private android.content.Context context;
this.activity = activity;
this.context = context;
Toast.makeText(context, "Hello", Toast.LENGTH_SHORT).show();