I am having a great difficulty on these part. I cannot call my dialog when I put my class inside Tab Group. Is there anyway I could do this?
This is my dialog creator
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case 1:
return createDialog();
default:
return null;
}
}
@Override
protected void onPrepareDialog(int id, Dialog dialog) {
switch (id) {
case 1:
// Clear the input box.
EditText text = (EditText) dialog.findViewById(TEXT_ID);
text.setText(textme);
text.setKeyListener(null);
break;
}
}
private Dialog createDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(SpecialofMonth.this);
final EditText input = new EditText(this);
input.setId(TEXT_ID);
builder.setView(input);
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
return;
}
});
return builder.create();
}
Calling it on button click
View.OnClickListener handlesReadme = new View.OnClickListener() {
public void onClick(View v) {
showDialog(1);
}
};
This one works when it is outside the tab group. But in vice versa or when it is inside, it is not working..
Can you help me out?
in side your TAB Group create like this