i want t run multiple activities simultaneously

by honey » Thu, 02 Sep 2010 01:54:42 GMT

Sponsored Links
 i have buil a file explorer just like a mycomputer.it reads the whole
storage and system for files and directories now.i am working with
start menu.i have built it in an other activity i wan to make them
active at the same time? can anyone help me out?


i want t run multiple activities simultaneously

by Mark Murphy » Thu, 02 Sep 2010 02:13:56 GMT

 You cannot have more than one activity visible at one time, sorry.

Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android App Developer Books:  http://commonsware.com/books 


Sponsored Links

Other Threads

1. Howto cleanup location listeners in activities properly

I have an Activity that implements LocationListener.

public class MyActivity extends MapActivity  implements

In my activity, I register a locationlistener in the onCreate()

lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, minTime,
distance, this);

In the onDestroy method, I'm removing the registration for my

protected void onDestroy() {
In my application, I can change the minTime and distance, so I re-
initialize my listener like this :

private void initializeGpsListener() {
    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, minTime,
distance, this);
For debugging purposes, I write something to the screen whenever a
provider is enabled (in this case GPS).

    public void onProviderEnabled(String provider) {
        Utils.addDebugMsg(this,"onProviderEnabled : " + provider);

What I noticed is that sometimes, multiple instances of my activity
(or locationlistener) are "kept around". Each time I turn the GPS
provider on, instead of seeing 1 statement "onProviderEnabled : GPS",
I see several different instances of my Activity printing this line
(all at the same time).

I want to keep the listener around, as it needs to update the location
even when the activity is not in the front , so removing it in
onPause() is not an option.

How do I clean up these listeners ( = my activities), and make sure
that only 1 remains active throughout the application.


2. Help interpreting MediaPlayer error

I have the following code:

this.mediaController = new MediaController(this);

In an activity onCreate, where videoView is, surprisingly, a VideoView.

when getVideoUrl is:
everything works fine.

when getVideoUrl is:http://www.afneurope.net/portals/main/Media%
I get a very cryptic error in my error logs and no other information on
a failure:
11-03 14:29:14.905: DEBUG/MediaPlayer(8900): Couldn't open file on
client side, trying server side
11-03 14:29:14.905: INFO/StagefrightPlayer(34):
11-03 14:29:16.015: ERROR/MediaPlayer(8900): error (1, -2147483648)
11-03 14:29:16.025: ERROR/MediaPlayer(8900): Error (1,-2147483648)
11-03 14:29:16.025: DEBUG/VideoView(8900): Error: 1,-2147483648
11-03 14:29:19.385: DEBUG/dalvikvm(61): GC_EXPLICIT freed 9548 objects /
505216 bytes in 242ms

The two streams have some differences, mainly audio codec, but both
codecs are supported by Android afaik.  Here is ffmpeg output for

Seems stream 1 codec frame rate differs from container frame rate:
1000.00 (1000/1) -> 14.98 (2997/200)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
    major_brand     : 3gp5
    minor_version   : 256
    compatible_brands: 3gp53gp4
  Duration: 00:01:35.60, start: 0.000000, bitrate: 161 kb/s
    Stream #0.0(eng): Audio: amrnb, 8000 Hz, 1 channels, flt, 12 kb/s
    Stream #0.1(eng): Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3],
122 kb/s, 14.92 fps, 14.98 tbr, 2997 tbn, 1k tbc
    Stream #0.2(eng): Data: rtp  / 0x20707472, 4 kb/s
    Stream #0.3(eng): Data: rtp  / 0x20707472, 15 kb/s

Seems stream 1 codec frame rate differs from container frame rate:
1000.00 (1000/1) -> 15.00 (15/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
    major_brand     : mmp4
    minor_version   : 1
    compatible_brands: mmp43gp53gp4
  Duration: 00:01:02.13, start: 0.000000, bitrate: 189 kb/s
    Stream #0.0(eng): Audio: aac, 22050 Hz, stereo, s16, 32 kb/s
    Stream #0.1(eng): Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3],
140 kb/s, 15 fps, 15 tbr, 600 tbn, 1k tbc
    Stream #0.2(eng): Data: rtp  / 0x20707472, 5 kb/s
    Stream #0.3(eng): Data: rtp  / 0x20707472, 8 kb/s
At least one output file must be specified

Can anyone give me some insight into what that error might mean?  



3. counting files in a cache

4. How to include external files into apk

5. Can't read our data from USB audio device (/dev/snd/dsp)

6. certification for android developers

7. Obtaining Name of Object Reference