How to return a value from a inner class?

前端 未结 5 579
抹茶落季
抹茶落季 2021-01-12 18:39

My code is here:

public static boolean showConfirmationDialog(Context context, String title, String dialogContent) {
        AlertDialog.Builder builder = ne         


        
5条回答
  •  佛祖请我去吃肉
    2021-01-12 19:07

    You can't return things from an inner class in this instance. In this case it doesn't make much sense. Is the program supposed to wait inside your onClick function until it returns something? That's not really how listeners work. What you need to do is take what ever code you plan on executing if "true" was returned, and put it inside your inner class.

提交回复
热议问题