views:

76

answers:

1

I have a ListView that uses Linkify to create a link to another activity in my app. the url looks something like content://com.myapp/activitiy/view?param=blah

this works fine every time.

however, in another view, I'm trying to call some code like this:

   Intent i = new Intent("content://com.myapp/activity/view?param=blah");
   i.setAction(Intent.ACTION_VIEW);
   startActivity(i); 

but for some reason this doesn't seem to work. It doesn't trigger my activity (and in fact it blows up if i dont include the setAction() call. How am I supposed to create the Intent such that it acts the same way that Linkify does...?

Now i realize i can setup the extras and then handle it in the activity, but that just seems like duplicated effort. So instead i'll spend the time it would have taken to do that, and post this question. SO any help much appreciated. :)

A: 

ah. just figured it out:

String uri = "content://...";
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(i);
Ben