final CharSequence[] items = {"Add Note", "Add Anniversary", "Add Event","View All"};
AlertDialog.Builder builder = new
AlertDialog.Builder(MyCalendar.this);
builder.setTitle("Add Details");
//builder.setIcon(R.drawable.calendarmonth);
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item)
{
if(item==0)
{
Intent in=new Intent(MyCalendar.this, AddNote.class);
startActivity(in);
}
else if(item==1)
{
Intent in=new Intent(MyCalendar.this, AddAnnivarsory.class);
startActivity(in);
}
else if(item==2)
{
Intent in=new Intent(MyCalendar.this, AddEvent.class);
startActivity(in);
}
else if(item==3)
{
Intent in=new Intent(MyCalendar.this, ViewAll.class);
startActivity(in);
}
}
});
AlertDialog alert = builder.create();
alert.show();
AlertDialog.Builder builder = new
AlertDialog.Builder(MyCalendar.this);
builder.setTitle("Add Details");
//builder.setIcon(R.drawable.calendarmonth);
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item)
{
if(item==0)
{
Intent in=new Intent(MyCalendar.this, AddNote.class);
startActivity(in);
}
else if(item==1)
{
Intent in=new Intent(MyCalendar.this, AddAnnivarsory.class);
startActivity(in);
}
else if(item==2)
{
Intent in=new Intent(MyCalendar.this, AddEvent.class);
startActivity(in);
}
else if(item==3)
{
Intent in=new Intent(MyCalendar.this, ViewAll.class);
startActivity(in);
}
}
});
AlertDialog alert = builder.create();
alert.show();
No comments:
Post a Comment