I am using an AppIntro library in my app.
It has 3 slides. I want to ask the user something when the third slide is shown. To achieve that I am using material dialogs b
public class MainActivity extend Activity{
MaterialDialog dialog;
protected void onCreate(Bundle savedInstanceState) {
dialog = new MaterialDialog.Builder(OrderInfoActivity.this)
.title("Reject?")
.content("Are you reject this order?")
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(MaterialDialog dialog, DialogAction which) {
Toast.makeText(OrderInfoActivity.this, "Option1", Toast.LENGTH_SHORT).show();
}
})
.onNeutral(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(MaterialDialog dialog, DialogAction which) {
Toast.makeText(OrderInfoActivity.this, "Option 2", Toast.LENGTH_SHORT).show();
}
})
.onNegative(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(MaterialDialog dialog, DialogAction which) {
Toast.makeText(OrderInfoActivity.this, "Option 3", Toast.LENGTH_SHORT).show();
}
}).build();
accept.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.show();
}
});
}
}
Here is what i'm using right now, and it's working
Hope it helps :)