Forum Xamarin Xamarin.Android

Best way to read new pdf file when you swipe?

fbs419fbs419 USMember ✭✭

I want to do a PassWallet kind of thing where when you swipe to the left or right, you read a new pdf file. I pick up the swipe gestures just fine, but my problem is the way I read pdf files; I just do it the standard way. As an example, when I pick up a swipe gesture, I do:

Java.IO.File f = new Java.IO.File(somePDFFile);
Android.Net.Uri uri = Android.Net.Uri.FromFile(f);
Intent theIntent = new Intent(Intent.ActionView);
theIntent.SetDataAndType(uri, GetString (Resource.String.application_pdf));

The Adobe reader will display the pdf file. The problem is that now I'm not in my activity anymore, so when I do a left or right swipe from the screen where the pdf is displayed, my code won't run. It only runs when I am in my own activity.

What is the best way to do this so that my activity is in control when pdf files are displayed?



  • fbs419fbs419 USMember ✭✭

    Do I have to try to use MuPdf or IText? I'm looking for a simpler solution. The pdf files are local to the phone, so I don't really want a WebView. I just want to be able to swipe left or right with another one of my local pdf files coming up each time, preferably without the Adobe Reader flashing up first. But I need to do it in my activity, so I have control, and can process the events in OnFling. Any suggestions would be welcome. Thanks

Sign In or Register to comment.