title: ImageView.setBitmapImage throwing nullpointer exception
body: <p>Im using a dialog to display a menu of choices to the user and within the dialog screen Im using an ImageView. Im using BitmapFactory.decodeFile() with the file path of the image to be used from the users sd card and I definitely have all the permissions set. Ive checked in the debugger and also through the use of log statements to make sure that the filepath and the bitmap are both worth something and not null. For some reason when it goes to use the image returned it throws a null pointer exception. Heres the small piece of code for the dialog's imageview</p>
  
  <pre><code>                        dialog2 = new Dialog(MyView.this);
  
                          LayoutInflater li =      (LayoutInflater) MyView.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                          View w = li.inflate(R.layout.userpreference, null, false);
  
                              dialog2.setContentView(w);
  
                              dialog2.setTitle("MY PREFERENCES");
  
      ////////////////////////////////////////////////////////////////////
                              profileImage = new ImageView(MyView.this);
                              profileImage = (ImageView) dialog2.findViewById(R.id.profileImage);
                              BitmapFactory.Options opts = new BitmapFactory.Options();
                              opts.inSampleSize = 16;
                              profileImage.setImageBitmap(BitmapFactory.decodeFile(curr_profimg,opts));
  </code></pre>
  
  <p>I noticed i didnt need the layoutinflater but I figured that might have something to do with the error. Heres the lines from the logcat</p>
  
  <pre><code>11-06 03:31:15.488: E/AndroidRuntime(11889): FATAL EXCEPTION: main
  11-06 03:31:15.488: E/AndroidRuntime(11889): java.lang.NullPointerException
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at graf.main.MyView$6$9.onClick(MyView.java:567)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at android.view.View.performClick(View.java:2485)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at android.view.View$PerformClick.run(View.java:9089)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at android.os.Handler.handleCallback(Handler.java:587)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at android.os.Handler.dispatchMessage(Handler.java:92)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at android.os.Looper.loop(Looper.java:130)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at android.app.ActivityThread.main(ActivityThread.java:3806)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at java.lang.reflect.Method.invokeNative(Native Method)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at java.lang.reflect.Method.invoke(Method.java:507)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  11-06 03:31:15.488: E/AndroidRuntime(11889):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>As always any input on the matter would be greatly appreciated</p>