How can I dynamically load an image into a dialog box in android
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
builder.setView(inflater.inflate(R.layout.popup, null));
}
I can only link static buttons and images into the view.
If I try to link images dynamically like
ImageView image = (ImageView) getActivity().findViewById(R.id.image);
image.setImageResource(R.drawable.icon);
image is being returned as a null object
Here is the solution
hope this helps!