title: Image view wont display image setImageBitmap()
body: <p>This works on Emulator (i use genymotion) but for some reason it wont work on a real device.
  image view wont display the image, i am sure that it is not empty because it shows path file. here's the code. when i start the app, all works fine except that the file (image) is not displaying on the image view. i tried looking into the logcat and there's no error regarding why the image won't display. thanks for answering</p>
  
  <pre><code>ImageView img_logo;
      protected static final int CAMERA_REQUEST = 1;
      protected static final int FILE_REQUEST = 2;
      private Uri imageCaptureUri;
  
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          view = inflater.inflate(R.layout.fragment_my_account, container, false);
          try{
          firstname = getArguments().getString("firstname");
          lastname = getArguments().getString("lastname");
          username = getArguments().getString("username");
          cno = getArguments().getString("cno");
          email = getArguments().getString("email");
          address = getArguments().getString("address");
          userID = getArguments().getString("userID");
  
          fullname = (TextView) view.findViewById(R.id.name);
          tv_uname = (TextView) view.findViewById(R.id.user_name);
          tv_cno = (TextView) view.findViewById(R.id.user_cno);
          tv_email = (TextView) view.findViewById(R.id.user_email);
          tv_address = (TextView) view.findViewById(R.id.user_address);
  
          //upload photo
          startDialog();
  
          DisplayImage();
          fullname.setText(firstname + " " + lastname);
          tv_uname.setText(username);
          tv_cno.setText(cno);
          tv_email.setText(email);
          tv_address.setText(address);
  
          }catch (Exception e){
              e.printStackTrace();
          }
  
          return view;
      }
  </code></pre>
  
  <p>method startDialog()</p>
  
  <pre><code>private void startDialog(){
          final String[] items = new String[] {"From Cam", "From SD Card"};
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(getActivity(), android.R.layout.select_dialog_item, items);
          AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
          builder.setTitle("Choose Action: ");
          builder.setAdapter(adapter, new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                  if (which == 0) {
                      Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                      File file = new File(Environment.getExternalStorageDirectory(), "tmp_avatar" + String.valueOf(System.currentTimeMillis())
                              + ".jpg");
                      imageCaptureUri = Uri.fromFile(file);
                      try {
                          intent.putExtra(MediaStore.EXTRA_OUTPUT, imageCaptureUri);
                          intent.putExtra("return data", true);
  
                          startActivityForResult(intent, CAMERA_REQUEST);
                      } catch (Exception ex) {
                          ex.printStackTrace();
                      }
                      dialog.cancel();
                  } else {
                      Intent intent = new Intent();
                      intent.setType("image/*");
                      intent.setAction(Intent.ACTION_GET_CONTENT);
                      startActivityForResult(Intent.createChooser(intent, "Complete Action using"), FILE_REQUEST);
                  }
              }
          });
          final AlertDialog dialog = builder.create();
          //image
          txt_image_path = (TextView) view.findViewById(R.id.image_path);
          img_logo = (ImageView) view.findViewById(R.id.display_image);
          img_logo.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  dialog.show();
              }
          });
      }
  </code></pre>
  
  <p>on Activity Result()</p>
  
  <pre><code>@Override
      public void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
  
          if(resultCode != Activity.RESULT_OK)
              return;
          Bitmap bitmap = null;
          String path = "";
          if(requestCode == FILE_REQUEST){
              imageCaptureUri = data.getData();
              path = getRealPathFromURI(imageCaptureUri);
              if(path != null){
                  bitmap = BitmapFactory.decodeFile(path);
              }else{
                  path = imageCaptureUri.getPath();
              }
  
          }else {
              path = imageCaptureUri.getPath();
              bitmap = BitmapFactory.decodeFile(path);
  
          }
  
          img_logo.setImageBitmap(bitmap);
          txt_image_path.setText(path);
  
      }
  </code></pre>