Lifecycle questions not sure please help

by jimmythesaint » Thu, 16 Apr 2009 07:56:24 GMT


Sponsored Links
 Hi

I am building my first app and I am not quite sure about the
architecture

I started with an object which holds the data. I pass this via Intents
to my activities and when they are done they pass it back ( if they
changed it ).  This seemed like a way of keeping data between
activities and is quite simple ( the object is serializable )

Now I am looking at the app lifecycle and I dont want to looe  data so
I am writing the object to a file on the onPause event of each
activity. Does this make sense ; writing data on each onPause  since i
dont know when the app could exit and be destroyed ?  Seems lke i may
as well not bother passing it throgh intents and just read it from
file on each activity start  ??

Thanks

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Mohon gabung ..

Dear rekan2,

Ikutan gabung, ya.. Dan salam kenal dari nubie asli.
Belum pegang robot ijo, tapi kemungkinan sesegera mungkin. Saat ini ingin 
mantau dulu ya, sambil sesekali bertanya.

Thanks Mods atas approvalnya :)

Hidayat

-- 
=========================
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

2. twtpic4j is not throwing exception

I am using this following function f1() in am android project... the
last line of the function SHOULD throw an exception as the twitter
username password is not correct, but it is not.. am I missing
anything here?

private void f1() {
                try {
                        // Create file

                        File f =new 
File(Environment.getExternalStorageDirectory(),
                        "gallery_pic.jpeg");
                        InputStream inputStream = new BufferedInputStream(new 
URL(
                                        
"http://www.faronet.be/files/u16/wikipedia.jpg")
                                        .openStream(), 1024 * 4);
                        OutputStream out = new FileOutputStream(f);
                        byte buf[] = new byte[1024];
                        int len;
                        while ((len = inputStream.read(buf)) > 0)
                                out.write(buf, 0, len);
                        out.close();
                        inputStream.close();
                        System.out.println("\nFile is created");

                        String username="appketttletest";
                        String pass="appkettlE";
                        TwitPic tpRequest = new TwitPic(username,pass);
                        TwitPicResponse tpResponse = null;

                        tpResponse = tpRequest.uploadAndPost(f, "Testing 
twitpic...");
                        System.out.println("user authenticated!!! he he, i dont 
know how");

                } catch (Exception e) {
                        Log.i("error","faliled");
                        e.printStackTrace();
                }
}

--

3. Portrait vs landscape using sensor

4. AudioTrack stop/release

5. Viamici 鈥?the First Map Cali bration Solution for the Android Platform

6. java access from Android Webkit plugin

7. JetCreator