Android Question ActionBar and Class problem...

Roger C

Active Member
Licensed User
Longtime User
Hi,
Finally got a working project with slidingmenues, actionbar in top and 'status'-actionbar in bottom and loading layouts from classes.

Everything works fine, apart from...

1. loading a second layout (ClsHistory), the actionbar in bottom won't show. But if I use CTRL + F11 to turn the device then it shows and also when I turn it back again. But it won't show from start.

2. the SetOnClickListner in layout two (ClsHistory) won't work.

When you run the attached app, there's a statusbar in bottom with two green images. If you click the button 'Checka in' one of the images turns red. So that listner is working...

To load the second layout, slide the screen to the right and there's some buttons, click on 'Historik' to open the second layout. Now there is no statusbar in the bottom. If you turn the device it turns up... and even if you turn it back again so there's nothing wrong with the layout.

If you now press the button 'Alla' nothing happens.
If you put a stop in the sub for the listner, you will never get there. So the listner never catches the button_click in layout two...


Please could someone help me out here?
 

Attachments

  • Test.zip
    41.8 KB · Views: 146
Last edited:

Roger C

Active Member
Licensed User
Longtime User
Ok, problem 2 solved above.
Of course I don't have to use SetOnClickListener if I catch the event inside the Class.

But still, problem 1... Why doesn't the actionbar show when changing the layout?
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
Ok, problem 2 solved above.
Of course I don't have to use SetOnClickListener if I catch the event inside the Class.

But still, problem 1... Why doesn't the actionbar show when changing the layout?
1) Because you remove all views from your activity and, as the ActionBar is already initialized, your code does not re-initialize it so the action panel stays removed from the activity.
2) And there's a comment mark before the call to the ActivityLowerBar sub.
 
Upvote 0

Roger C

Active Member
Licensed User
Longtime User
Thanks Informatix!!
I'm a big fan of your tutorials and your work here. :)

Removed the
ActionPanel.RemoveAllButtons
and intialize it every time instead. Works like a charm.
 
Upvote 0
Top