how to test the existence of a specific activity ?

by hapciu » Wed, 04 Feb 2009 13:57:20 GMT

Sponsored Links
 Is there a way to find out whether a specific activity is present on
the phone ? I mean without firing an intent to start it and then catch
the exception.



how to test the existence of a specific activity ?

by Dan Raaka » Wed, 04 Feb 2009 14:57:15 GMT

 This should help 



Sponsored Links

how to test the existence of a specific activity ?

by Al Sutton » Wed, 04 Feb 2009 16:41:13 GMT

 getPackageManager() in a Context gives you one of these; 

You can then use #getActivityInfo(android.content.ComponentName,%20int)
If you know the package class name, or #getInstalledApplications(int)
if you just want to have a rummage through whats installed.


Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 


Other Threads

1. Play sound frequently using AudioTrack

Hi all,

I'm currently trying to use the AudioTrack class to play a sound

Here is a brief description of what i'm doing.
I'm launching a Thread which runs as a daemon and generates a sound
every 500ms.

To generate the sound :
- I instanciate an AudioTrack class in MODE_STATIC, with a buffer size
equal to the size of the byte array i'm going to play.
- I write the raw PCM data as a byte array once.
- I call play the first time i have to play the sound, and then the
only way i managed to replay it is by calling stop(), reloadStaticData
(), setPlaybackHeadPosition() and play() again.

Now let's say i want to play this sequence for 2s.
I press the start button, the Thread runs an infinite loop and calls 4
times the method which plays the sound, then i press the stop button.
I should hear the sound played 4 times, but in fact i hear it 6-7

What am i doing wrong ?

I'm new to Java and Threads, and i can't identify if this is a kind of
synchronization problem or if it comes from my AudioTrack usage.

I'm using MODE_STATIC because in MODE_STEAMING the write method is
blocking and i can't play a sound which is more than 500ms long.


2. Can a Text View request and receive focus

Can a Text View request and receive focus?

3. porting mplayer for android

4. Device Update!!!

5. Capture hardware button while screen is locked

6. Touch screen not up yet

7. copybit