• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Action bar does not show in tab

 
John Joe
Ranch Hand
Posts: 55
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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



 
L Foster
Ranch Hand
Posts: 185
10
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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: 185
10
Android Java Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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: 55
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic