This piece of code works !!! Thnks

On Jun 26, 4:25 pm, Peli <peli0...@googlemail.com> wrote:
> This code works regardless in which package the action is located.
>
> The only improvement I would suggest is to change the last argument
> form
> String action
> to
> Intent intent
> and omit the line " final Intent intent = new Intent(action); "
>
> Then you can search for arbitrary intents that you want to launch,
> including those that use data or a mime type.
>
> (here is the modified 
> source:http://code.google.com/p/openintents/source/browse/trunk/NotePad/src/...
> )
>
> Peliwww.openintents.org
>
> On Jun 26, 11:02 am, ani <anish198519851...@gmail.com> wrote:
>
>
>
> > Hi All,
>
> > I have a query to ask.This piece of code i have come across in one of
> > the posts (http://android-developers.blogspot.com/search/label/How-to
> > by Romain Guy )  in which author has said
>
> > "simple way to find out whether the system contains any application
> > capable of responding to the intent you want to use".
>
> > public static booleanisIntentAvailable(Context context, String
> > action) {
> >     final PackageManager packageManager = context.getPackageManager();
> >     final Intent intent = new Intent(action);
> >     List<ResolveInfo> list =
> >             packageManager.queryIntentActivities(intent,
> >                     PackageManager.MATCH_DEFAULT_ONLY);
> >     return list.size() > 0;
>
> > }
>
> > But this code is working only if my androidmanifest.xml file has the
> > particular intent{isIntentAvailable(this,action =
> > ("com.android.aaaa")--this string is defined as intent filter in my
> > androidmanifest.xml )}.
>
> > However this is not working if i am trying to find out an intent which
> > is in some other apk and this "other apk" is installed in my
> > system.Can i do this using the code shown above or it is not possible?
>
> > regards,
> > ani- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to