Take the 2-minute tour ×

I'm very new to android, I've be coding in .NET for a few years I'm trying to create an application that will launch another application while passing some data to it. I've been chatting to the developer of the other application and he said

Following is what I wrote in the AndroidManifest.xml:

         <activity android:name=".EmulatorActivity"
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="file" />
                <data android:mimeType="application/x-n64-rom" />

You should set the Intent URL to something like 'file://path/rom_file', and set its mime type to 'application-x-n64-rom'.

I've no idea how to do this though, I can successfully launch his application using

Intent intent = new Intent(Intent.ActionMain);
            intent.SetComponent(new ComponentName("com.androidemu.n64", "com.androidemu.n64.MainActivity"));

but if I change the ActionMain to ActionView and MainActivity to EmulatorActivity it tries to fire up but crashes I've also no idea how to pass the variables :) I've tried lots of combinations but know idea where I'm going wrong The filename I would like to pass is on the root of the sd card call n64.zip

I tried intent.PutExtra(Intent.ExtraStream, Android.Net.Uri.Parse("file://sdcard/n64.zip"));



share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

You can try this and see if it's working:

Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW);
myIntent.setDataAndType(Uri.fromFile("filepath"), "application/x-n64-rom");
share|improve this answer
I get no overload takes 2 arguments for Android.Net.Uri.FromFile –  Stu1983 Feb 11 '12 at 0:06
Sorry, there was a parentheses missing. Should work now. –  Michell Bak Feb 11 '12 at 0:31
add comment

Needs more information. Where does it crash?

The constructor for your Intent ought to be new Intent(Intent.ACTION_MAIN). I have no idea what Intent.ActionMain is, unless it's part of the development environment you're using.

You can't change intent.SetComponent() at will. The component package and class name have to exactly match the other activity.

share|improve this answer
I'm using Mono for Android, its def Intent.ActionMain but I assume that corresponds to ACTION_MAIN. My application doesn't crash, it's the application I am trying to start appears then immediately crashes. –  Stu1983 Feb 11 '12 at 0:01
add comment

Your Answer


