Creating a new popup window when a user presses a button
I want to generate a new popup window in 开发者_如何转开发my app, similar to this image in an android application. How can I do this?
Thank you for any help you can provide!
You will need to use a dialog. For general questions like yours which are not related to a specific issue or roadblock, it's usually better to use the Android documentation instead of going straight to stackoverflow. The Android docs will usually have an entire guide page or set of pages devoted to important topics like creating dialogs. Like so: http://developer.android.com/guide/topics/ui/dialogs.html
I would point you to this tutorial. Here
It's the Date Picker tutorial. I'm sure you could create your own pop up window to display. I just would know how to make that.
private DatePickerDialog.OnDateSetListener mDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
mYear = year;
mMonth = monthOfYear;
mDay = dayOfMonth;
updateDisplay();
}
};
精彩评论