SetText of TextView in DialogFragment from Calling Activity
问题 Building an Android app and having some trouble. I'd appreciate any help! I have created an class that extends DialogFragment (Account_Create_Error) that I call from Activity A. I want to set the TextView field in this DialogFragment from Activity A. I created a method in my dialogfragment public void setError(String message) { TextView error = (TextView)getActivity().findViewById(R.id.message); error.setText(message); } I then use this method in Activity A by doing Account_Create_Error error