title: Receiving data from another app in xamarin,android
body: <p>I had made an app using xamarin.android that plays with images. I want other app to share images to my app, I tried the following but throws exception.</p>
  
  <p>Here is Android manifest file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" 
            package="ReceiveDataFromApp.ReceiveDataFromApp" 
            android:versionCode="1" 
            android:versionName="1.0"&gt;
    &lt;uses-sdk android:minSdkVersion="21" /&gt;
    &lt;application android:allowBackup="true" android:label="@string/app_name"&gt;
      &lt;activity
         android:name=".MainActivity"
         android:label="@string/app_name"&gt;
        &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.VIEW" /&gt;
          &lt;action android:name="android.intent.action.SEND" /&gt;
          &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;data android:mimeType="image/*" /&gt;
        &lt;/intent-filter&gt;
      &lt;/activity&gt;
    &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Main.axml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
      &lt;ImageView
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:id="@+id/imageView"
         /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>MainActivity.cs</p>
  
  <pre><code>namespace ReceiveDataFromApp
  {
      [Activity(Label = "ReceiveDataFromApp", MainLauncher = true)]
      public class MainActivity : Activity
      {
          protected override void OnCreate(Bundle savedInstanceState)
          {
              base.OnCreate(savedInstanceState);`
  
              // Set our view from the "main" layout resource
              SetContentView(Resource.Layout.Main);
  
              ImageView imageView = (ImageView)FindViewById(Resource.Id.imageView);
  
              if (Intent.Data != null)
              {
                  try
                  {
                      var uri = Intent.Data;
                      var iis = ContentResolver.OpenInputStream(uri);
                      imageView.SetImageBitmap(BitmapFactory.DecodeStream(iis));
                  }
                  catch (Exception e)
                  {
                      Toast.MakeText(this, e.Message, ToastLength.Long).Show();
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Exception:</p>
  
  <pre><code>Java.Lang.RuntimeException: Unable to instantiate activity ComponentInfo{ReceiveDataFromApp.ReceiveDataFromApp/ReceiveDataFromApp.ReceiveDataFromApp.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "ReceiveDataFromApp.ReceiveDataFromApp.MainActivity" on path: DexPathList[[zip file "/data/app/ReceiveDataFromApp.ReceiveDataFromApp-1/base.apk"],nativeLibraryDirectories=[/data/app/ReceiveDataFromApp.ReceiveDataFromApp-1/lib/arm, /data/app/ReceiveDataFromApp.ReceiveDataFromApp-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
  </code></pre>
  
  <p>Do correct what I am doing wrong.</p>