• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Action bar does not show in tab

 
Ranch Hand
Posts: 570
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have three tabs (A,B,C) and I want to add a **home** action bar on each tab. Not sure what I have missed here, no action bar is shown on each fragment. Below show the code of Fragment A.

Fragment A






tab_1_menu



 
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, thanks for bringing this capability to my attention. I have been developing an Android app, and did not realize I could make such a tool bar. After seeing this post, I looked around at other apps and noticed it prominently along the top. So now I am doing the same thing: adding this to my app.

To do it, I am starting with their tutorial at https://developer.android.com/training/appbar/setting-up.html , which first tells you that you must extend AppCompatActivity for any Activity that needs a toolbar.

Right now, as I write this, I am updating my environment so this class exists to be extended. That is actually taking a surprisingly long time. Perhaps I should have installed only a subset of the things suggested. Either way, when I get this right, I will post whatever gotchas I've run into.
 
L Foster
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found that the process of using that AppCompatActivity technique working--though recommended for some good reasons--was going to be very time-consuming, and introduce a lot of bulk into my APK download. So, I am shelving that effort for now. Instead, I have learned I could just edit my menu item XMLs, and add this attribute to each item.



And this caused these items to appear at top-of-screen, in the ActionBar.

I see you have already thought of that. In the interest of not wasting your time, I will at least point to a link I found which seems to address this specifically.

http://www.grokkingandroid.com/adding-action-items-from-within-fragments/

Thanks again, for bringing this feature to my attention.
 
John Joe
Ranch Hand
Posts: 570
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

L Foster wrote:I found that the process of using that AppCompatActivity technique working--though recommended for some good reasons--was going to be very time-consuming, and introduce a lot of bulk into my APK download. So, I am shelving that effort for now. Instead, I have learned I could just edit my menu item XMLs, and add this attribute to each item.



And this caused these items to appear at top-of-screen, in the ActionBar.

I see you have already thought of that. In the interest of not wasting your time, I will at least point to a link I found which seems to address this specifically.

http://www.grokkingandroid.com/adding-action-items-from-within-fragments/

Thanks again, for bringing this feature to my attention.




Thanks a lot
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic