Success not calling when selecting PDF files
renanboni opened this issue · comments
Hi,
I've been trying to upload a pdf file using the library but without success so far, when I select a PDF file using the library the success callback isn't called, any clue on my problem?
Can you provide the code you're using to upload a pdf?
I've just successfully selected and resolved a pdf. Where are you trying to load the pdf from? How does the content URI look like?
@schlan thank you for your reply, here's what I'm doing:
I have an activity with 2 buttons, which open the camera and the documents, respectively:
ctnCamera.setOnClickListener { Belvedere.from(this) .camera() .open(this) }
ctnGallery.setOnClickListener { belvedere .document() .contentType("application/pdf") .open(this) }
And then I register the callback on the activity result method:
`Belvedere.from(this).getFilesFromActivityOnResult(
requestCode,
resultCode,
data,
object : Callback<List>() {
override fun success(result: List) {
}
}
})`
The on success method is called but without any results, even though when I select images.
Here's the whole code: https://gist.github.com/renanboni/20264bde60cc98d6c45c6786ddd366db
And the debug log:
D/Belvedere: Parsing activity result - Gallery - Ok: true
Number of items received from gallery: 1
Resolving items
The success callback is not called but the onActivityResult is.
Hey, I was trying to send the pdf files using the emulator, using real device works fine.