Android Question layout and activity

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
i have layout (A) and that layout raised from (A1) activity witch has all its events
witch also contain a panel (p) ,
and layout (B) witch launched and processed from activity (B1)
, layout (C) witch launched and processed from activity (C1)
i want to load layouts B,C to the panel in layout A and every one of them keep processed in its activity.

i tried to do that and the B,C layouts loaded to the panel in layout (A) successfully, but the process in their activities doesn't work.

any solutions
 

ilan

Expert
Licensed User
Longtime User
i have layout (A) and that layout raised from (A1) activity witch has all its events
witch also contain a panel (p) ,
and layout (B) witch launched and processed from activity (B1)
, layout (C) witch launched and processed from activity (C1)
i want to load layouts B,C to the panel in layout A and every one of them keep processed in its activity.

i tried to do that and the B,C layouts loaded to the panel in layout (A) successfully, but the process in their activities doesn't work.

any solutions

it depends what you want to do

example: layout B contains a Label called "lbl1"

and you load it to the panel "p" in activity A1
now if you want to change the lbl1.text from a button event in activity A1 you need to declare it also in acitvity A1
since you cannot declare views as Process Global object (to make them public)

so you need to be careful if you load same layouts in more then 1 activity to not have 2 views with the same name.
and if you do that (make sure each view has an individual name) you can declare the same view in each acitivity and like this you can handle it from each activity.
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
what i need is to load many layouts with its activities to one a panel witch located in one layout
can that panel be public ????
i tried using Panel1.LoadLayout and all layouts loaded successfully but buttons in them didn't work, it looks they didn't see their activities after loading them to that panel.
that exactly what i want
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
layout and activity are 2 different things. you cannot load an activity to a panel. you can load a layout and as i said in post #2 if you want to handle a layout from more then 1 activity you will have to declare on each activity the needed views. a view cannot be public but you can load a layout to more then 1 activities if you declare the views on this activity.
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top