Sunday, February 28, 2010

Re: [android-developers] Re: Passing a LinearLayout from one Activity to another

If I were to have one class(java non Android but within the same Application) create a LinearLayout dynamically consisting of 'n' views 
And then let us say we want to spawn a new Activity with this LinearLayout in it then how would we do this.
Is there a good approach for this?
I do realize this is not the recommended way of doing things, but nevertheless is there a way to achieve it?
-------------------------------
Aniruddh Bajirao

Sent from my iPhone

On Feb 28, 2010, at 8:13 PM, Aniruddh Bajirao <abajirao@gmail.com> wrote:

Thanks a lot. 
I just wanted to know if such things are possible and shud it be done. 
I was havin a discussion on Intents  and someone raised this question. After thinking about it for a while and trying it out (obviously it didn't work), I thought I'd ask for help on the forum. 
What we were trying to do was to create a LinearLayout outside an Activity and then pass it to an activity. No real reason there... just experimenting cos we were discussing it.

Thanks for ur ideas on this.

On Sun, Feb 28, 2010 at 11:45 AM, Zigurd <zigurd.mednieks@gmail.com> wrote:
Can you clarify what you are trying to do? It's hard to see why you
want to do what you are asking about.

If you are trying to display the same information, from the same data
model, in two identical-looking views in two different activities, you
should create a class that extends AdapterView if your data model
contains several of the same kind of thing. If the data is all
different kinds, use the observer/observable classes in either
android.database or java.util to connect two views to the same data
using an implementation of the observer pattern. If the views can be
in two different apps, use a ContentProvider component. If you want
the views to look identical, use the same XML to specify how they
look.

On Feb 28, 10:36 am, Aniruddh Bajirao <abaji...@gmail.com> wrote:
> For a rather crazy reason I am trying to pass a linearLayout from one
> activity to another.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Great spirits have always found violent opposition from mediocrities. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence.
... Albert Einstein.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Aniruddh Bajirao
http://myblog.abajirao.com/myblog

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate