Discussion Forums  >  Status Bar, Navigation Bar

Replies: 16    Views: 18592

Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
07/20/14 10:18 AM (5 years ago)

Hide Icon/logo in Action bar in Android Project?

Hi
had to rewrite my post. Basically I want to remove the icon logo from my action bar in Android.

I have been told that users can turn of the show notifications settings on their phone, but I need to over-write the phone settings to hide in my app as it takes up valuable space.

I've been told it happens to Android 4.0 upwards.

Does anyone know how to do this?
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
like
07/20/14 10:44 AM (5 years ago)
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
07/20/14 10:50 AM (5 years ago)
Hi Burns
thanks for the link. Unfortunately, I'm not a strong coder especially for Android, so have no idea where to add this code.

Is this a problem you know off?
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
like
07/20/14 10:52 AM (5 years ago)
Ive had it a few times on apps I would rather not have the icon displayed for whatever reason - confess I gave up too! Was hoping that given the link and some of the talent on here a quick response would follow :)
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
07/20/14 10:59 AM (5 years ago)
There are a few Android developers, might PM some, because its doing my nut as well. Absolutly pointless to have this extra bar.
 
chris1
Code is Art
Profile
Posts: 3860
Reg: Aug 10, 2012
Oklahoma City, ...
50,100
like
07/20/14 11:14 AM (5 years ago)
Try this? Seems like a pretty simple solution if it works.

http://stackoverflow.com/questions/14606294/remove-icon-logo-from-action-bar-on-android
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
07/20/14 11:27 AM (5 years ago)
Hi Chris
forgive me, but I'm no coder, very bad to be precise. Could you possibly tell me how as I have no idea where to place the code.
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/20/14 03:01 PM (5 years ago)
Try putting it in the onCreateView method
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/20/14 04:20 PM (5 years ago)
Or actually it might be the OnCreateOptionsMenu method.I know bt_fragment.java is what sets up all of this.take a look in there.im not at any computers right now to check
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
07/21/14 12:24 AM (5 years ago)
Hi CM
any further assistance would be hugly appreciated. Struggling here.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/21/14 07:45 AM (5 years ago)
looks like I'm going to have to start doing more android.

Survey says it's an action bar

find actionbar in bt code

hey there you are in BT_activity_host.java in the src folder.
First method on create.

First option under this

//setup the android action bar with a custom view for the title text...
actionBar = getActionBar();
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_USE_LOGO);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setTitle(getString(R.string.loading));

add this
actionBar.setDisplayShowHomeEnabled(false);

according to google's api stuff this removes the home button or the icon in this case.

option 2

change this
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_USE_LOGO);

to this

actionBar.setDisplayOptions(0);


I have only tested this on a basic app but does the trick I think, just comment out changes while experimenting


For more info on the action bar checkout the API
http://developer.android.com/reference/android/app/ActionBar.html
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/21/14 08:20 AM (5 years ago)
I never tried it but looked at bt_fragment.java in onCreateMenuoptions method.I think its the last statement in there.try commenting it out to see what it does
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
07/21/14 08:27 AM (5 years ago)
Thank you Kittsy, will try now.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/21/14 08:29 AM (5 years ago)
@CMCOFFEE isn't that the code for the little pop down menu on the right
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
07/21/14 08:55 AM (5 years ago)
YES YES YES! Kittsy I'm about to call the queen and put you forward for a Knighthood for your outstanding achievements to BT.

This may sound like I'm kissing your ass, but its better than kissing your balls. Your the man!

GREAT FIX!
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/21/14 01:14 PM (5 years ago)
Yes it is ha dont know what I was thinking.I knew I seen it in oncreate methods somewhere when looking at stack overflow.Didnt even see you had posted the answer ha.thanks!
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/21/14 02:20 PM (5 years ago)
now that I think about it you should never modify the bt_fragment.java.it kind of sets up everything and can be changed from cp or overriden from a plugins class,since they extend bt_fragment
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.