android-actionbar

NullPointerException on setShareIntent using ActionBarSherlock

别来无恙 提交于 2019-12-24 00:43:21
问题 I'm trying to use ActionBarSherlock + ShareActionProvider in a SherlockActivity. I've already checked this ( NullPointerException using ShareActionProvider + actionbarsherlock) but it doesn't solve my problem. I think the code is correct, but I keep getting FC and this logcat: 07-25 15:31:26.758: E/AndroidRuntime(911): FATAL EXCEPTION: main 07-25 15:31:26.758: E/AndroidRuntime(911): java.lang.NullPointerException 07-25 15:31:26.758: E/AndroidRuntime(911): at com.corsalini.david.calcolopesi

How to change the color of actionbar (actionbarsherlock)

末鹿安然 提交于 2019-12-24 00:33:45
问题 How to change the color of actionbar (actionbarsherlock) ? I've been tried below code but no luck. <style name="MyTheme.ActionBarStyle" parent="Widget.Sherlock.ActionBar"> <item name="background">#ffffffff</item> </style> <style name="Theme.SherlockCustom" parent="@style/Theme.Sherlock.Light"> <item name="actionBarStyle">@style/MyTheme.ActionBarStyle</item> </style> +and one thing more, i'm add submenu like below. this button's background color is also white(because Sherlock Theme). could i

ActionBar with ViewPager - clicking partially visible tab crashes the app

谁说我不能喝 提交于 2019-12-24 00:17:42
问题 I'm using a ViewPager to display 4 different fragments. I use the action bar to display the tabs for the navigation. It looks like that: My problem is that initially 3 of the tabs are fully visible and the last one is partially visible. Clicking on any of the first 3 tabs is ok but when I click on the last one, the app crashes: 09-06 13:35:01.825: E/AndroidRuntime(6676): FATAL EXCEPTION: main 09-06 13:35:01.825: E/AndroidRuntime(6676): java.lang.IllegalStateException: Content view not yet

Centring the title on the android AnctionBar using the style.xml possible?

被刻印的时光 ゝ 提交于 2019-12-24 00:14:18
问题 I would like to center my app's title displayed on the ActionBar. So far I have customised its background color using only the style.xml file, like this: <!-- Application theme. --> <style name="AppTheme" parent="@android:style/Theme.Holo.Light"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <item name="android:actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar"> <item name=

Actionbar gets hidden when i use android:windowSoftInputMode=“adjustPan”

天大地大妈咪最大 提交于 2019-12-24 00:09:14
问题 Manifest <activity android:name="com.example.Thread" android:label="Thread" android:windowSoftInputMode="adjustPan" android:parentActivityName="com.example.Home" > <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.example.Home" /> </activity> Layout XML file <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="

How to add Toolbar to a fragment in android?

十年热恋 提交于 2019-12-23 23:24:07
问题 I have a fragment named as HomeFragment.java and it extends Fragment class. import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.example.android.test.R; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; public class HomeFragment extends Fragment { private Toolbar toolbar; public View onCreateView

Activity's title area doesn't expand if the title is set from a Fragment that doesn't contribute to the options menu

半城伤御伤魂 提交于 2019-12-23 21:33:20
问题 This is very similar to the issue mentioned here, which mostly fixed my problem. However, if you are setting the title from a fragment that does not contribute to the options menu , then the title area won't expand. This can cause an ellipsis if the initial title was very small, even though there may be plenty of room in the action bar for it. My guess is that if the fragment does contribute to the options menu then it causes that title area's width to be recalculated. Is there a way to force

Not Too Happy with the Android Action Bar… How Can I Reduce Its Size

天涯浪子 提交于 2019-12-23 20:11:59
问题 I don't really like the new Action Bar Android has come up with -- and apparently forced me to use in later API levels. But, since it appears I'm stuck with it -- I have no more Menu Button and I need the functionality I've lost, I'd like to minimize the annoyance factor. Can anybody tell me how NOT to display the Icon/Logo? It's easy enough to suppress the Title, but the logo is still too much -- and provides zero helpfulness. Also, can anybody tell me how to reduce the height of the bar?

How to get Lollipop “hamburger” as drawer icon in standard Fragment app (without use AppCompat)?

橙三吉。 提交于 2019-12-23 20:00:26
问题 When i use AppCompat lib (v21) i got ActionBar with new style of "hamburger" icon. Is possible to get the same behaviour, but not using AppCompat. I'd like to have standard Holo.Light theme with new "hamburger" (drawer) icon in ActionBar. 回答1: You can get the assets you want from the official github account of Google Here the link for the xxhdpi density ic_menu_white xxhdpi And set it to your Action bar with the method setIcon() 来源: https://stackoverflow.com/questions/28664124/how-to-get