Skip to content Skip to sidebar Skip to footer

How Can I Pass A Value To A Android Dialog?

I have a dialog in which I am trying to pass a float to, like this: public void rateDialog(View v){ // custom dialog AlertDialog.Builder builder = new AlertDialog.

Solution 1:

You can declare it as final:

publicvoidrateDialog(View v){
    // custom dialogfinalFloatvalue=1;

}

and use it in the dialog.

Solution 2:

Can you paste your rate_stars.xml, how it looks.

If you are using RatingBar, then you can set rating in java file, and then call show method.

If you are not using RatingBar, try it it will be simple in setting ratings.

Post a Comment for "How Can I Pass A Value To A Android Dialog?"