title: how to show PDF from mobile storage in xamarin android c# app?
body: <p>I am working in a xmarin android app in c#. I want to open a pdf file which is in a custom folder of internal storage "TESTFOLDER". code is given below, every time it is going to the catch section whiche it is going to start the activity. how to open it?
  <a href="https://i.stack.imgur.com/UW2M4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UW2M4.jpg" alt="enter image description here"></a></p>
  
  <p>code</p>
  
  <pre><code>var externalPath = global::Android.OS.Environment.ExternalStorageDirectory.Path + "/TESTFOLDER";
                  Java.IO.File file = new Java.IO.File(externalPath, "qdummy.pdf");
                  if(file.Exists())
                  {
                      try
                      {
                          file.SetReadable(true);
                          Android.Net.Uri uri = Android.Net.Uri.FromFile(file);
                          Intent intent = new Intent(Intent.ActionView);
                          intent.SetDataAndType(uri, "application/pdf");
                          intent.SetFlags(ActivityFlags.ClearWhenTaskReset | ActivityFlags.NewTask);                        
                          intent.SetFlags(ActivityFlags.NoHistory);
                          StartActivity(intent);                        
                      }
                      catch (Exception ex)
                      {
                          Toast.MakeText(Application.Context, "problem", ToastLength.Long).Show();
                      }
                  }
                  else
                  {
                      Toast.MakeText(Application.Context, "No exx", ToastLength.Long).Show();
                  }
  </code></pre>