I have the following DialogFragment with the following method :
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
builder.setView(inflater.inflate(R.layout.buddy_challenge, null));
this.title = (TextView)getActivity().findViewById(R.id.challenge_title);
this.challenge = (Button)getActivity().findViewById(R.id.challenge_button);
this.at = (AutoCompleteTextView)getActivity().findViewById(R.id.chall_ex);
ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("action", "getAllEx"));
new ServerCallEx().execute(params);
return builder.create();
}
The custom layout inflates properly but if I try changing the TextView or try attach an Adapter to the AutoCompleteTextView I get a null pointer exception and can't figure out why (don't know why the getActivity.findViewByID() is not working). Help!