Android Question Layouts designed for Pages in Tabstrip control are visible even after activity is closed

beelze69

Active Member
Licensed User
Longtime User
Hi,

I am loading 2 different layouts for 2 different pages of a Tabstrip control.

Layout outlines (especially of Buttons created in the layouts) are visible of Pages of the Tabstrip Control even after the particular activity is closed.

How do I clear the such layouts from the screen completely so that only the Tabstrip Background colour for the particular active page is visible post closure of the activity ?

Thanks in advance...
 

beelze69

Active Member
Licensed User
Longtime User
Hi Erel,

Thanks for your reply.

Actually the buttons created under a 'layout 1' are visible post closure of the activity. I can not only see their brief outlines but they also seem to 'get depressed' when I attempt to click on them.

However, I resolved it as follows:

i) First I set the visible property of all components of the Layout to FALSE (during design time)
ii) Post the loading of the activity, in the 'Activity_Create' subroutine I am making all the components of the Layout VISIBLE.
iii) In the 'Activity_Pause' subroutine under the IF UserClosed ...End if loop I am again making all the layout components Invisible (setting VISIBLE property to false).

This way my TABSTRIP pages are CLEAN post Activity unloading

I am a new user and am still in the learning phase.

Kindly advise me if there is a better approach.

Thanks..
 
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
Hi Klaus,

Yes.. ps. wait.. I am making one .. Actually this happens when the properties of the components of the layout are SET to VISIBLE at DESIGN TIME.
 
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
Hi Klaus,

I think I am making some mistake.. Actually If I have a Layout1 and the related activity for that Layout1 under ActivityForLayout1, then I am loading the Layout1 first in Tabstrip1.LoadLayout("Layout1","Tab 1")... Then under Page_Selected subroutine depending on value of Position parameter, I am calling StartActivity("ActivityForLayout1").

Now inside ActivityForLayout1.b4a program, in the Activity_Create subroutine I am saying Activity.LoadLayout("Layout1") i.e. AGAIN I am loading that same layout (this time inside ActivityForLayout1 program).

Actually my intention is just to Have a "TAB 1" and "TAB 2" but the Tabstrip1.LoadLayout subroutine requires a LAYOUT to be loaded in the first parameter.

I just want to put a TAB and NOT want to load any layout first.

Can you advise me what to do ?

Thanks ...
 
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
Hi Klaus,

I am attaching 2 Zip files .. The Tabstripbehaviour is the ZIP file in which I have detailed my problem (you can see the visuals)..
The 2nd Zip file shows the view that I want and how I have done that in a 'crude way'.

Thanks for all the help,
 

Attachments

  • requiredbehaviour.zip
    224.1 KB · Views: 264
  • Tabstripbehaviour.zip
    223.9 KB · Views: 249
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
Hi Klaus,

Sorry .Since I am a newbie, I missed out on that one.. Thought source will be inside the zip... Am loading the Source also ...

Thanks for extending your help,
 

Attachments

  • srcTabstripbehaviour.zip
    11.4 KB · Views: 233
  • srcRequiredbehaviour.zip
    11.5 KB · Views: 255
Upvote 0

klaus

Expert
Licensed User
Longtime User
Sorry, but I don't understand what you want.

Currently you are loading the layout layoutforK onto Tab1.
When Tab1 is selected, you start Activity PopulateSpinners where you also load the layout layoutforK.
So, when you go back to Main activity the layout layoutforK will be reloaded and displayed.
If you don't want layout layoutforK on Tab1 you should not load it there.

Questions:
1) What do want to display on Tab1 ?
2) What exactly is the purpose of Activity PopulateSpinners ?
If it's 'only' populating the Spinners this won't work, because when you go back to activity Main the layout is reloaded and the Spinners are empty.
 
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
Hi Klaus,

Thanks for reverting back.

1) I just want 'TAB 1' text to be displayed on the TAB PAGE ..The LoadLayout method of the Tabstrip control expects a LAYOUT file to be provided as a first parameter, so So is there any way by which I can display only 'TAB 1' , 'TAB 2' words on the top of each page ? (without loading the layout ?) .

2) My another request - When I am loading layoutFork1, I want that TAB 1 to be visible up (Currently the layoutFork1 occupies the ENTIRE screen space)... In simple words, I want to load my screens 'within the TAB PAGE area' (the TAB Panels should be visible[in my present case it is not])... In classical VB6, I would have used a Picture control in the Tabstrip control (which would work something like a Frame control and place all my visual components inside it)... Something like that...

3) The populateSpinners function will populate the spinners with some values from some table... There are no issues with that part. I will open a table in PopulateSpinners function and will load some values there...


My main issues are:

a) A way by which I can display only 'TAB 1', 'TAB 2' on the Tab panels without loading any kind of LAYOUT.. (a function which will only allow me to specify the Tab Text [without the compulsion to load a layout file])..

b) A way by which whenever I am loading any 'LAYOUT file' in the pages of the Tabstrip control, I can still see the TAB 1, TAB 2 TABS (currently my layout files occupy the entire SCREEN AREA [camouflaging the Tabs of the TabStrip control)...

Thanks..
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I think you need to learn how Android works.
What an Activity is, what a layout is, the process life cycle etc.
It's different from VB.
In VB you have one Form one dedicated layout.
In Android, a layout is not dediceated to an Activity, they are completely independant.
You can, for example, have several Panels, each one with its specific layout, in a same Activiy.

You might read the Beginner's Guide:
Chapter 9 Process and Activity life cycle.
Chapter 14.2 Program with three Activities
You might also have a look at this thread: Different examples with 2 layouts

To display text on Tab1 you should define a layout with a Label to display the text.
If you want the Tabs be always visible you should not start a new Activity, but use Panels covering only a part of the screen, on the Main activity, and set those visible or hidden.
 
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
Thanks Klaus.. I will go through them..

Once again thanking you for taking out the time to explain everything ...
 
Upvote 0
Top