У меня есть диалоговое окно, в котором я пытаюсь передать поплавок к, например:Как передать значение в диалоговом окне Android?
public void rateDialog(View v){
// custom dialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
// Add the buttons
builder.setPositiveButton("save", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User clicked OK button
}
});
builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User cancelled the dialog
}
});
// Set other dialog properties
// Create the AlertDialog
builder.setTitle("Rate this Beer");
builder.setView(getLayoutInflater().inflate(R.layout.rate_stars, null));
AlertDialog dialog = builder.create();
RatingBar ratingBar = (RatingBar) this.findViewById(R.id.beerRatingBar);
float stars = ratingBar.getRating();
dialog.show(stars);
// Create the AlertDialog
}
Является ли это на самом деле возможно, и если да, то как?
Как насчет использования диалогового окна «Диалог»? Вы ориентируетесь меньше API 11? –