Nested activities question

by jb » Fri, 23 Apr 2010 00:48:09 GMT


Sponsored Links
 I have an application that allows the user to "drill-down" into data.
At each level of data the user can choose a Tableview item or a
Listview item. This will result in a startActivity() call for display
of new data.

I can get back to the top (Parent activity) by using the Back button,
which can take a while. Is there a way to "POP" back to the Parent
activity and dismiss all previously allocated activities, and not have
to go back through all the activities previously created?

TIA,

jb

--



Nested activities question

by ~ TreKing » Fri, 23 Apr 2010 01:48:27 GMT


 



See this thread:


Sponsored Links


Nested activities question

by krox » Fri, 23 Apr 2010 02:03:01 GMT


 Hi!

rootActivityIntent) with the flag FLAG_ACTIVITY_REORDER_TO_FRONT set
for rootActivityIntent. Hope this is what you were looking for, for
more information see:

 http://developer.android.com/reference/android/content/Intent.html #FLAG_ACTIVITY_REORDER_TO_FRONT

Cheers,
Erik



>



Other Threads

1. FW: FormatDateTime

All:

So I realized my date/time is already formatted by time zone and re-adding
the default time zone was subtracting the time zone offset again from the
time!  So, new code to replace the formatting function is below:

        Date date = df.parse(dateTime);
                                 
        if (sdk < 3) {

                finalDateTime = df.format(date);
                                         
        } else {

                finalDateTime = DateUtils.getRelativeDateTimeString(this,
date.getTime(), dateMin, dateMax, dateFlags).toString();

        }

So, why is it called "reflection" anyways?  Is it like "reflecting" on all
those previous SDK versions and thinking about the special times we had w/
them?

Thanks,
Nick Owens
VP, ThreeClix
Office: (904) 429-7039
Mobile: (847) 565-9392
After Hours: (904) 540-5830


-----Original Message-----
From: Nick Owens [mailto:nicow...@gmail.com] 
Sent: Thursday, February 25, 2010 5:38 PM
To: 'android-developers@googlegroups.com'
Subject: RE: [android-developers] Re: FormatDateTime

Mark (et. al. interested parties):

Thank you for the example on reflection.  I got it working and thought it
might be prudent to share my results w/ the world so the completed code is
below.  For the record, this date value (as a string) is being retrieved
from a SQLite database and the function formatDateTime() is used in a custom
adapter for display of the date for each record in a ListView.

This compiles in Eclipse using Android 1.5.  This allows me to set a minimum
sdk version of 2, while still utilizing this really nifty date display
function.

----------------------------------------------------------------------------
------------
public class ResourcesList extends ListActivity {

        ...

        int sdk = new Integer(Build.VERSION.SDK).intValue();

        private static final long dateMin = 60000;
        private static final long dateMax = (86400000 * 2);
        private static final int dateFlags = 0;

        ...

        public String formatDateTime(String dateTime) {
                 
                if (dateTime == null) {
                         
                        return "Never";
                         
                } else {
                         
                        String finalDateTime;
                         
                        DateFormat df = new SimpleDateFormat("yyyy-MM-dd
HH:mm:ss");
                         
                        try {
                                 
                                Date date = df.parse(dateTime);
                                 
                                if (sdk < 3) {

                                        finalDateTime = df.format(date);
                                         
                                } else {

                                        long when = date.getTime();
                                         
                                        finalDateTime =
DateUtils.getRelativeDateTimeString(this, (when +
TimeZone.getDefault().getOffset(when)), dateMin, dateMax,
dateFlags).toString();

                                }
                                 
                        } catch (Exception e) {

                                finalDateTime = "Unknown";
                                 
                        }
                         
                        return finalDateTime;
                         
                 }

         }

        ...

}

Thanks,
Nick Owens
VP, ThreeClix
Office: (904) 429-7039
Mobile: (847) 565-9392
After Hours: (904) 540-5830


-----Original Message-----
From: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] On Behalf Of Mark Murphy
Sent: Thursday, February 25, 2010 4:23 PM
To: android-developers@googlegroups.com
Subject: Re: [android-developers] Re: FormatDateTime




Yes, either via reflection or via conditional class loading.

Eclipse

No, it should work fine. However, you need to compile for the higher
version.

specifying

Dunno. What's Android 1.2? :-)


Yes, either via reflection or via conditional class loading.

This was discussed here:

http://stackoverflow.com/questions/2312321/how-to-use-contacts-api-for-andro
id-1-x-and-2-x-simultaneously

and here:

http://stackoverflow.com/questions/2044985/android-contactscontract-and-buil
ding-across-multiple-sdk-versions

Some sample projects are here:

http://github.com/commonsguy/cw-advandroid/tree/master/Contacts/Pick/
http://github.com/commonsguy/cw-advandroid/tree/master/Contacts/Spinners/

First one uses reflection, second one uses conditional class loading.

Here are two more samples:

http://github.com/commonsguy/cw-android/tree/master/APIVersions/

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

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 

2. Bluetooth A2DP/AVRCP profiles on Android

Hello,

I would like to develop a software using Bluetooth A2DP/AVRCP profiles
on Android.
I could not find the related API on the developer's website at this
moment.
But, I found a product by Sybase below.
http://www.sybase.com/detail?id=1064424
Do we have any other option?
Thank you very much in advance.

Regards,

-- 

3. Any built-in intent for viewing a single image?

4. what is the CRITICAL POINT of view layout to get hit by StackOverflowError exception

5. what is the CRITICAL POINT of view layout to get hit by StackOverflowError exception

6. Intercepting incoming/outgoing email messages

7. Ask sw NMG