LayoutInflater i = getLayoutInflater();
View inflate = getLayoutInflater().inflate(R.layout.linear1, null); //on custom view add linear1
Toast t = Toast.makeText(getApplicationContext(),"",Toast.LENGTH_SHORT);
t.setView(inflate);
t.setGravity(Gravity.BOTTOM |Gravity.FILL_HORIZONTAL,0,0);
t.show();
final TextView textview2 = (TextView)inflate.findViewById(R.id.textview2); if you click textview2
textview2.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {
showMessage("You click the dismiss");
}
});
//make custom view with linear1
//add textview1 and 2
//to cancel
Toast t = Toast.makeText(getApplicationContext(),"",Toast.LENGTH_SHORT);
t.cancel();
Komentar