I've been trying some other stuff, too, now. And this doesn't even
seem to work:

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(intent);

I would expect that to ask me which app I want to launch. Instead I
get a Force Close error.

On Apr 9, 11:59 am, droozen <[email protected]> wrote:
> No, when I try to call the intent with startActivity I get a Force
> Close error, whether I try:
>
> Intent intent = new Intent();
> intent.setAction("intent.action.VOLUME_CONTROL");
> startActivity(intent);
>
> or
>
> Intent intent = new Intent("intent.action.VOLUME_CONTROL");
> startActivity(intent);
>
> with this filter in my manifest for the other app it's trying to call:
>
> <intent-filter>
>                 <action android:name="intent.action.VOLUME_CONTROL"/>
>                 <category
> android:name="android.intent.category.DEFAULT" />
> </intent-filter>
>
> I don't have any special permissions I'm asking for, and I'm not using
> any special permissions in the calling app. I have a feeling that I'm
> missing something very simple, but I can't find any documentation that
> says I'm doing anything wrong. Anyone know what I'm doing wrong?
>
> (I know, to avoid the error at least, I could check to see if that
> intent is available and whatnot, but I'm just trying to test to see if
> it can work so i can make the intent available from my app)
>
> On Apr 8, 9:07 pm, Birjodh Tiwana <[email protected]> wrote:
>
> > So did the second  way work for you?
>
> > On Wed, Apr 8, 2009 at 12:24 PM, droozen <[email protected]> wrote:
>
> > > Sorry. The second way I tried to start the intent was:
>
> > > Intent intent = new Intent("intent.action.VOLUME_CONTROL");
> > > startActivity(intent);
>
> > > (without the com.roozen in front)
>
> > > On Apr 8, 11:12 am, droozen <[email protected]> wrote:
> > > > Maybe this belongs in the beginners group, but I'm trying to make my
> > > > application available through an intent. It's a volume controller app,
> > > > so I figured it might be handy for another application to be able to
> > > > call it to adjust volume without having to write their own.
>
> > > > In my volume controller app, I have this activity as my main screen:
>
> > > > <activity android:name=".MainSettings" android:label="@string/
> > > > app_name">
> > > >                         <intent-filter>
> > > >                                 <action
> > > android:name="android.intent.action.MAIN" />
> > > >                                 <category
> > > android:name="android.intent.category.LAUNCHER" />
> > > >                         </intent-filter>
> > > >             <intent-filter>
> > > >                 <action android:name="intent.action.VOLUME_CONTROL"/>
> > > >                                 <category
> > > android:name="android.intent.category.DEFAULT" />
> > > >             </intent-filter>
> > > > </activity>
>
> > > > From another app, I call with:
>
> > > > Intent intent = new Intent();
> > > > intent.setAction("intent.action.VOLUME_CONTROL");
> > > > startActivity(intent);
>
> > > > Or I've tried:
>
> > > > Intent intent = new Intent("com.roozen.intent.action.VOLUME_CONTROL");
> > > > startActivity(intent);
>
> > > > Neither works. The process trying to call the other app fails. I've
> > > > also tried removing the category.DEFAULT category from my intent
> > > > filter, with no success.
>
> > > > What am I missing?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to