title: Get Current Activity Xamarin forms
body: <p>I used Leadtools SDK for Barcode reader , when i try to get current activity it gives me null </p>
  
  <p>This is my code </p>
  
  <pre><code>   Stream resourceStream = new MemoryStream();
          // Droid.MainActivity activity = Forms.Context as Droid.MainActivity;
          var activity = Android.App.Application.Context as Activity;
  
          int resId = activity.Resources.GetIdentifier("Datamatrix", "drawable", "com.companyname.UDOSE");
       resourceStream = activity.Resources.OpenRawResource(resId);
       var leadStream = LeadStream.Factory.FromStream(resourceStream);
       await ReadBarcode(leadStream);
  </code></pre>
  
  <p>activity always null , how can i solve this ?</p>