Android design question

by frizzo » Wed, 11 Mar 2009 13:53:12 GMT


Sponsored Links
 The system in place to pass information between the screens... I am
confused why the team chose to reinvent the wheel via the putExtras
methods.  Instead of making the transport objects inherit from
Parcelable and the like, why not just use Java's OO strength and set
objects to Activities themselves.  For instance, like this:


class Caller extends Activity {
   public on buttonClick() {
          ThisScreen ts = new ThisScreen();
          ts.SetCustomValue(10);

          startActivity(ts)
   }
}

class ThisScreen extends Activity {
   public void onCreate() {
       txtBox.setText(Integer.toString(i));
   }

   public void SetCustomValue (int i) {
            ...
   }
}

Instead we are having to unnecessarily learn new concepts.  Was there
a compelling reason to implement it they it's implemented that I am
not seeing?

Thanks.

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



Android design question

by Jean-Baptiste Queru » Wed, 11 Mar 2009 21:18:32 GMT


 The reason is that the activities in question might live in different
processes, and therefore the parameters that are passed to
startActivity might have to be marshalled across virtual machines,
across processes (and across UIDs).

JBQ






-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

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


Sponsored Links


Android design question

by frizzo » Thu, 12 Mar 2009 14:53:20 GMT


 Ahh, understood.  Having said that, perhaps in the next rev, it'd be
good include a shortcut for in-process activity changes.

Regards




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



Other Threads

1. NBA: LeBron James and Dwyane Wa de鈥檚 statistical comparison

NBA: LeBron James and Dwyane Wade statistical comparison

If youe a Miami Heat fan it like a fairy tale come true. It was
possible to believe that Dwyane Wade would re-sign with the Miami Heat
but to imagine LeBron James to actually join his 2003 batch buddies in
the franchise was like a mere illusion, believing Santa Claus is real
sounds more pragmatic. Some say it still seems so unreal, to imagine
two of the youngest and highly regarded players working together.

Read the full article: 
http://blogs.bettor.com/NBA-LeBron-James-and-Dwyane-Wades-statistical-comparison-a20860

-- 

2. Android application ideas

Hello,
I am final year engg student planning to develop an android
application,I want some suggestions for the same.My group desires to
develop an android application for video editing or image
processing.can anyone guide us for the project or provide materials
regarding the same?Material in the form books,articles,links or
videos.Thanking you people in advance and i hope i get replies as soon
as possible!
tc

-- 

3. ADB Driver Not Found Windows Vista 64 - T-Mobile MyTouch3g Slide (?HTC Expresso?)

4. multiple views and asynctask...

5. Necessary to close SQLite database?

6. Click handling from multiple buttons on a screen

7. Some Issues related to signing APK with multiple certificates