android-actionbar

How to show a circular logo in action bar in Android?

会有一股神秘感。 提交于 2019-12-23 02:28:50
问题 Just like the screenshot of Google Plus above, I want to show a circular avatar image in the action bar. What should I do? 回答1: Create circular imageview. Create custom view for actionbar using the circular imageview Inflate the view and display custom view as action bar. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="50dp" android:background="@drawable/black_pattern" > <TextView android:id="@+id/title_text

Android - How to get parentActivityName attribute value programmatically?

梦想的初衷 提交于 2019-12-23 02:28:27
问题 An activity is declared in my manifest like this: <activity android:name=".TicketingHomeActivity" android:label="@string/title_activity_ticketing_home" android:parentActivityName=".HomeActivity" /> How can I get the value of android:parentActivityName programmatically? I need to do this as I have just replaced my ActionBar with a Toolbar, but getSupportActionBar().setDisplayShowHomeEnabled(true) is now showing the Up arrow in an activity even when there is no parentActivityName attribute set

Custom viewpager tabs with custom view, multiple fragment and layouts

拥有回忆 提交于 2019-12-23 02:07:08
问题 I want to make a viewpager which is just like latest facebook application. and the problem is with tabs. however i tried to make it, but i need icons with text in tabs and multiple fragments and layouts associated with it. two issue occurred when i tried to develop. 1. I compromised with my UI, and tried putting static icons in it, but they don't change on selection and they don't even have badge like in facebook application. 2. when i put that code in my application which i have developed in

Android Action Bar SearchView NullPointerException adjustDropDownSizeAndPosition

坚强是说给别人听的谎言 提交于 2019-12-23 01:17:50
问题 The problem occurs when interacting with the SearchView or when the activity with the Searchview loads. When using setIconifiedByDefault(true) the problem occurs after the activity loads when interacting with the SearchView, but when using setIconifiedByDefault(false) the problem occurs when the activity loads. The following error is output in LogCat: java.lang.NullPointerException at android.widget.SearchView.adjustDropDownSizeAndPosition(SearchView.java:1244) Here is the code:

Android action bar overflow menu not displayed in portrait mode

隐身守侯 提交于 2019-12-22 20:27:08
问题 I have a standard Android action bar (I'm not using the compatibility library) with a SearchView and a handful of text-only menu items. I'd like to have the SearchView always expanded and the remaining items in the overflow menu. The code I have so far works fine on a tablet and on my Nexus 5 in landscape mode, but when the phone is in portrait mode, the overflow menu isn't displayed. If I add the collapseActionView attribute to the SearchView, the overflow menu is properly displayed, but I'd

ListActivity with ActionBar support v7

和自甴很熟 提交于 2019-12-22 18:28:46
问题 My main Activity extends ListActivity, and now I have to implement an ActionBar with support for older versions. I have readed about the ways to do this, and I decided to try this way: I downloaded the source code of ListActivity, I modified few things, and now I need to implement here the ActionBar, so I'm trying to extend this Activity to ActionbarActivity. This way, I would have a custom ActionBarListActivity, and I could extend my Activity to this custom class, have then the functionality

Gmail Android App like ActionView/Spinner (NAVIGATION_MODE_LIST)

给你一囗甜甜゛ 提交于 2019-12-22 17:24:30
问题 I am trying to achieve NAVIGATION_MODE_LIST like gmail Android Application. My main issue is to hide the currently selected item from spinner list. so for example as shown here in if you select Sent then it will only have other elements shown in the spinner. My Understanding says that it is a custom ActionView rather than using NAVIGATION_MODE_LIST with custom adapter. 回答1: If someone else is looking for the solution to this problem here it is, Here is sample code which is written with the

best way to show the three dot menu item in action bar without using “a hack” method [closed]

断了今生、忘了曾经 提交于 2019-12-22 10:43:10
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I am a little confused. I want to show the remaining items of the action bar inside the three dot item. But i always lose it when the number of items increases ! after googling a little, i found this "useful" method : ASMUIRTI ANSWER private void getOverflowMenu() { try {

changing title text color and size of menu android action bar

送分小仙女□ 提交于 2019-12-22 09:24:58
问题 I am developing android application and in my application I am using Sherlock action bar. I am using some menu into my action bar. <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/card_menu" android:title="C123" android:showAsAction="always"> <menu> <item android:id="@+id/C0" android:title="C0"/> <item android:id="@+id/c1" android:title="c1" /> <item android:id="@+id/c2" android:title="c2" /> </menu> </item> <item android:id="@+id/notification" android

How does action_bar_embed_tabs exactly work in Android?

╄→гoц情女王★ 提交于 2019-12-22 08:37:17
问题 I have tabs in an actionbar. On large screens the tabs are embed to the actionbar but on small screens the are not. I want to control the tabs manual so i can separate the tabs from the actionbar. I tried to set abs__action_bar_embed_tabs but that didn't work <resources> <bool name="abs__action_bar_embed_tabs">false</bool> </resources> 回答1: I know this is an old post, however I would like to add a solution using action_bar_embed_tabs for future readers. Create the below method (do take care