Recovering Activity Stack?

by Gerry Rodman » Sat, 27 Mar 2010 04:55:17 GMT


Sponsored Links
 Use Case:

User performs menu action to spawn Child Acitivity (CA) from Main
Activity (MA).  CA is translucent allowing MA to be viewed as shaded
background.  (CA is spawned using startActivity.  Also I have tried
using startActivityForResult but it still does not give the desired
result.)

User presses Home Key and switches to another app.  Via the home key,
he switches back to App in question.

Actual and undesired result:

User views CA (OK).  It is translucent and in background, user can see
the the activity of the unrelated application (Not OK) he first
switched to via Home Key.  If user presses back button, he returns to
the unrelated application (Not OK).

Desired Result:

User views CA.   It is translucent and in background, user can see
MA.  If user presses back button, he returns to MA.

Can anyone tell me how to get to desired result?

Thank you,

gr

--



Other Threads

1. Advice for speeding up my drawing

Hi, I am creating an app that show some histograms off your traveling
speed in different time periods (histogram for the last minutte,
histogram for the last 2 minuttes etc.)

I would like to have an animation, and have discovered that drawing
everything takes arround 300-400ms. wich is to long for making my
animation smooth, the animation itself is quite simple (2 lines and 2
dots).

What i draw every frame right now is
20 antialised strings, size 14,  in average ~5chars
8 of these strings will change every second.
1 of the string will change with the animation (this will become 5
strings if there is time)

the main part of the screen, the one showing the histogram data,
consist of a lots of squares wich needs to be updated every second.
(450 squares)

the presentation is split into 5 frames in the same view (has to be
same view as arrows in one frame might point into another frame)

invalidating only a part off the screen makes almost no difference (it
does becomas a bit faster, but i still execute all my drawing stuff).
I have tried to add a flag wheter or not the main part is dirty, but
if i don't draw it, it is cleared. I might be missing something
here...

One possibility could be to render all the mostly static stuff to a
bitmap, and then simply draw the bitmap.
that would mean 10 strings only had to rendered on orientation change.

I think it would make sence since the slowest rutine is the one
drawing all the text. (the following is a typical timing for the
drawing rutines, accmulated).

V/HMMULTIBAR(  352): 0 - Drawing time: 0 ms
V/HMMULTIBAR(  352): 1 - Drawing time: 53 ms
V/HMMULTIBAR(  352): 2 - Drawing time: 62 ms
V/HMMULTIBAR(  352): 3 - Drawing time: 85 ms
V/HMMULTIBAR(  352): 4 - Drawing time: 280 ms
V/HMMULTIBAR(  352): 5 - Drawing time: 303 ms

I would really appreciate comments about wheter or not offscreen
rendering is the way to go, or if there is a simpler way.
--~--~---------~--~----~------------~-------~--~----~

2. asic2 touchscreen



Try changing the above code by adding some additional logic for the
reporting of the key BTN_TOUCH value such as below:

if (pressure > MIN_TOUCH_PRESSURE) {
        input_report_abs(ts->input, ABS_X, xtmp);
        input_report_abs(ts->input, ABS_Y, ytmp);
        input_report_abs(ts->input, ABS_PRESSURE, pressure);
        input_report_key(ts->input, BTN_TOUCH, 1);
        input_sync(ts->input);
} else {
        input_report_abs(ts->input, ABS_PRESSURE, 0);
        input_report_key(ts->input, BTN_TOUCH, 0);
        input_sync(ts->input);
}





Here is the major problem. All of the key input events are
automatically filtered out by the input framework in the kernel and
they never reach user space (i.e., the Android stack) because the
event bit for keys is not set.
Add this line to indicate you will be reporting key events in your
driver:
set_bit(EV_KEY, ts->input->evbit);

I know it sounds odd that you have to report key events for a
touchscreen driver, but that is what the user space Android code is
triggering off of as it is looking for touch events.


The code above does not hurt anything, but it is redundant given the
code below does the say thing.

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Get activity current view

4. Is ppp used to set up GPRS connection on G1?

5. <Android-Beginners> Query : How to get the full path of the files under "res" folder of an Android App?

6. Help in ViewGroup

7. Error : Unknown URI: content://media/external/images/media