passing context as argument of DialogFragment

后端 未结 4 2104
挽巷
挽巷 2021-02-01 03:15

it\'s possible to pass a context variable to a DialogFragment?

i\'ve use this code inside dialog for passing a string:

public static ConfirmDialog newIns         


        
4条回答
  •  臣服心动
    2021-02-01 04:07

    onAttach(Activity activity) is now deprecated,

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
    }
    


    use onAttach(Context context) instead

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
    }
    

提交回复
热议问题