Android Question .

DonManfred

Expert
Licensed User
Longtime User
I guess you are doing it wrong... See the StdActionBar Example-Code!

B4X:
    bar.Initialize("bar")
    bar.NavigationMode = bar.NAVIGATION_MODE_TABS 'change to list to see the other mode
    bar.SetListItems(Array As String("Dropdown 1", "Dropdown 2", "Dropdown 3"))
    bar.Subtitle = "This is the subtitle"
    bar.ShowUpIndicator = True
    Activity.Title = "This is the title"
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I have v6 and it says it won't run properly and it doesn't. When compiling it gives an error
You should start with this issue. Create a new thread if you need help on this. Post the error message you got.


Try to reproduce the problem with a small example project and upload this project.
 
Upvote 0

ronell

Well-Known Member
Licensed User
Longtime User
BUG? (I am using B4a version 6.0)

===========================
If you look at the code below (which is very short) you will see that I set
Activity.Title = "aaaa"
and it does nothing.\

i dont really understand the issue here .. but for me , i just go with the designer to set the activity title ..
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Activity.Title = "aaaa"
bar.Subtitle = "bbbb"

Activity.AddMenuItem("Return To Game","Help")

Activity.LoadLayout("layoutmain.bal")
It's not a bug, it's the order you are performing the instructions. Each layout file has an activity title attribute which will set the title when you load it. So, in your example:
B4X:
Activity.Title = "aaaa"   ' <=== Sets the title to "aaaa" at this instant -- display will not change as the sub is still running, blocking UI updates
And then,
B4X:
Activity.LoadLayout("layoutmain.bal") ' <==== Now sets the activity title to whatever you defined in the layout

If you want, try moving your activity title change to the last line of your Activity_Create and see if it does what you wish.
 
Upvote 0
Top