Trying to inflate a custom layout for an AlertDialog, but keep getting this waring. I've seen several different solutions to this but don't know which is correct for my scenario. What is the actual correct way of getting rid of this null warning?
Avoid passing null as the view root (need to resolve layout parameters on the inflated layout's root element)
@Override
public void onClick(View v) {
AlertDialog alertDialog = new
AlertDialog.Builder(getActivity()).create();
LayoutInflater inflater = getActivity().getLayoutInflater();
View content = inflater.inflate(R.layout.dialog_customd, null);
alertDialog.setView(content);
alertDialog.show();
}
@SuppressLint("InflateParams") View content = inflater.inflate(R.layout.dialog_customd, null);
a good idea? – Whiffen