i just installed xamarin android on windowsn and in xamarin studio created a new android solution, this is the code for the only one activity i have
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace MyNav
{
[Activity (Label = "MyNav", MainLauncher = true)]
[IntentFilter (new[]{Intent.ActionView},Categories=new[]{Intent.CategoryBrowsable})]
public class MainActivity : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.Main);
String url = this.Intent.DataString;
if (null == url) url = "No Data Provided";
TextView textView = (TextView)FindViewById (Resource.Id.url);
textView.Text = url.ToString ();
}
}
}
i added the intent filter attribute so it can be used by another project like a browser, the problem here is that the attribute doesnt add anything to the androidmanifest.xml, no matter what changes i add it always stay like this.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="MyNav.MyNav">
<uses-sdk android:minSdkVersion="10" />
<application android:label="MyNav"></application>
</manifest>
this is supposed to be loaded with this code by another application
Android.Net.Uri uri = Android.Net.Uri.Parse( URL );
Intent intent = new Intent (Intent.ActionView, uri);
Intent chooserIntent = Intent.CreateChooser (intent, CHOOSER_TEXT);
StartActivity (chooserIntent);
but the chooser doesn't show the activity in the dialog because it not recognize the attribute.
how is supposed the attribute has to work?, it adds internally the code to androidmanifest?, or it would be added to the file in the project??