1

I'm new in Android Programming and this my very first app. I'm getting a problem with intents. File chooser is returning data value as null and also resultCode as -1. Though I'm getting requestCode as given.

I have tried couple of solutions as followed:

1
2

I'm trying to implement this code.

**EDIT**

My code so far is: here

Community
  • 1
  • 1
Yogesh
  • 453
  • 1
  • 4
  • 12
  • is it only in some devices ? – Nithinlal Sep 03 '16 at 11:42
  • Can you show us your code of the activity that gets called for the result? – reVerse Sep 03 '16 at 12:08
  • 1
    [That code](http://stackoverflow.com/questions/22619325/android-directory-and-file-chooser-android-library) is terrible. `file/*` is not a valid wildcard MIME type, and the `getRealPathFromURI()` is completely wrong. Do not use that code. – CommonsWare Sep 03 '16 at 12:11
  • thnx for replying, @Nithinlal : I have tried on Genymotion 4.4.2 custom device and Redmi Note 4g. It doesn't work on any of them. @reVerse : There is no any other activity there. File choose dialog pops up and lets user to to select a file @CommonsWare : 1. I have changed `file/*` with `image/*` as in [mycode](http://pastebin.com/y8zT4VHz) and also getRealPathFromURI() seems to be working fine as Android Studio is not giving any error. – Yogesh Sep 03 '16 at 13:01

0 Answers0