![](https://img.haomeiwen.com/i2154563/df3aee2bdcf60a47.png)
![](https://img.haomeiwen.com/i2154563/c623b80135b08b08.png)
![](https://img.haomeiwen.com/i2154563/8be8178a96734ef5.gif)
Icon
Alerter.create(this)
.setText("Alert text...")
.setIcon(R.drawable.ic_face)
.show();
![](https://img.haomeiwen.com/i2154563/027ef68b78b3330a.gif)
On screen duration, in milliseconds
Alerter.create(this)
.setTitle("Alert Title")
.setText("Alert text...")
.setDuration(10000)
.show();
Without title
Alerter.create(this)
.setText("Alert text...")
.show();
![](https://img.haomeiwen.com/i2154563/358db2829f85e011.gif)
Adding an On Click Listener
Alerter.create(ExampleActivity.this)
.setTitle("Alert Title")
.setText("Alert text...")
.setDuration(10000)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(ExampleActivity.this, "OnClick Called", Toast.LENGTH_LONG).show();
}
})
.show();
![](https://img.haomeiwen.com/i2154563/dbf248816c018ab2.gif)
Verbose text
Alerter.create(ExampleActivity.this)
.setTitle("Alert Title")
.setText("The alert scales to accommodate larger bodies of text. " +
"The alert scales to accommodate larger bodies of text. " +
"The alert scales to accommodate larger bodies of text.")
.show();
![](https://img.haomeiwen.com/i2154563/0ab80d40a4bcac23.gif)
网友评论