android-actionbar-compat

ActionBarCompat: Hide ActionBar before activity is created (bug?)

强颜欢笑 提交于 2019-11-28 23:22:37
So I was using the ActionBarSherlock and decided to switch to the new ActionBarCompat. With ABS, hiding the ActionBar was possible using the way described in this post: How to hide action bar before activity is created, and then show it again? But, with the ActionBarCompat the app crashes on API14, because when you set android:windowActionBar as false the getSupportActionBar() method returns null, even if you have declared the getWindow().requestFeature(Window.FEATURE_ACTION_BAR); into the onCreate() method. Funny thing is that if you call getActionBar() instead, you get the object and

ActionBarCompat - how to use it

浪尽此生 提交于 2019-11-28 23:11:14
问题 I'm trying to use ActionBarCompat on my own project. I've already opened the sample project (http://developer.android.com/resources/samples/ActionBarCompat/index.html), But I don't know how to implement it on my own. I can't find any tutorial of some kind. Should I make this project as a library? Can someone give me some directions, please. 回答1: As for implementation, just stick to the sample code provided under the MainActivity.java class. You can find it here or under <your local android

How to change the text color of SlidingTabLayout?

不打扰是莪最后的温柔 提交于 2019-11-28 18:41:52
I made an application which use the ActionBarCompat I created the tabs using the SlidingTabLayout class. the class is this: SlidingTabLayout.java but I can not change the color of the tabs... my viewpager fragment is this: <swmovil.fyb.SlidingTabLayout android:id="@+id/mTabs" android:layout_width="match_parent" android:layout_height="48dip" /> <android.support.v4.view.ViewPager android:id="@+id/mPager" android:layout_width="match_parent" android:layout_height="0px" android:layout_weight="1" android:background="@color/white" /> the application works great, but i can´t change the color text of

ActionBar 'up' button destroys parent activity, 'back' does not

谁说我不能喝 提交于 2019-11-28 17:10:46
I have a relatively simple Android app with one Activity showing a list of items and another showing details of a selected item. I start the list activity, which is my topmost activity (using FLAG_ACTIVITY_CLEAR_TOP to clear the login activity from which this is called) with: Intent intent = new Intent(this, ListInstancesActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); finish(); and from within that activity I act on an item being selected with: Intent detailIntent = new Intent(this, ShowInstanceActivity.class); detailIntent.putExtra(ShowInstanceFragment

ActionBarActivity of “android-support-v7-appcompat” and ListActivity in Same activity

怎甘沉沦 提交于 2019-11-28 16:51:43
问题 How to use ActionBarActivity of "android-support-v7-appcompat" in the activity which Extends the ListActivity. For Example I have an Activity public class xxxxxListActivity extends ListActivity implements OnItemSelectedListener { // ................... } In the above activity i want to use "ActionBarActivity" but as java dosent support multiple inheritance I am not able to get it working. 回答1: Here's an implementation of ActionBarListActivity: public abstract class ActionBarListActivity

How to enable homeAsUp or call setDisplayHomeAsUpEnabled() on standalone toolbar with appcompat v21

浪子不回头ぞ 提交于 2019-11-28 16:19:53
I am trying to convert my app to use the v21 AppCompat library, so I started to use Toolbar instead of ActionBar. In all my regular activities (which extend ActionBarActivity) everything is fine. but in my SettingsActivity which extends PreferenceActivity, and therefore I can't use the setSupportActionBar(actionbar) call I need to use a "standalone" toolbar. The toolbar shows up, but I can't figure out how could I add the "home / up" button to the toolbar. SettingsActivity.java: public class SettingsActivity extends PreferenceActivity { @Override protected void onCreate(Bundle

Android: Appcompat 21 how to add shadow on actionbar

荒凉一梦 提交于 2019-11-28 15:11:47
问题 I add the new material design actionbar from the new appcompat and I use the new toolbar widget. I set a custom background on the toolbar on xml but my problem is that the drop shadow from the actionbar is not displayed. Do you know how to do this? Toolbar code <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/my_awesome_toolbar" android:layout_height="wrap_content" android:layout

How to add support libraries?

拥有回忆 提交于 2019-11-28 10:25:28
I added android-support-v7-appcompat. Next I clicked on each file in directory \libs. Then I clicked android-support-v7-appcompat and opened properties. Next checked files from directory libs and unchecked Android Dependencies. Next opened properties of myproject. Went to the projects and by Add button added android-support-v7-appcompat. But nothing is working. How can I make ActionBarActivity(there is no new variants) and how can I add a theme. I used to add in manifest to activity, tried to add it to the style.xml I solved my problem. It was hard to me to find add Library button. I acted in

Upgrading to SDK 21 - Error inflating class android.support.v7.internal.widget.ActionBarContainer

风流意气都作罢 提交于 2019-11-28 08:24:01
I'm trying to upgrade my app from API19 to API21 The main changes I've made to the gradle properties are: compileSdkVersion 21 buildToolsVersion "21.0.2" minSdkVersion 8 targetSdkVersion 21 compile 'com.android.support:appcompat-v7:21.0.0' The app builds ok, but I always get the following error: 10-22 23:10:38.867 7972-8058/com.example.android.demo E/ACRA? com.example.android.demo fatal error : Unable to start activity ComponentInfo{com.example.android.demo/com.example.android.demo.MainActivity2}: android.view.InflateException: Binary XML file line #27: Error inflating class android.support.v7

AppCompat Action Bar library not displaying added fragments

你离开我真会死。 提交于 2019-11-28 08:01:14
问题 EDIT : If I extend FragmentActivity instead of ActionBarActivity my layout shows up again (without an ActionBar of course). The ActionBar works as intended on 4.x devices, but on my 2.3 device all I get is the ActionBar and a blank screen below it. The Fragment doesn't seem to be getting added to the Activity . themes.xml <style name="AppTheme" parent="AppBaseTheme"> <item name="actionBarStyle">@style/Widget.ActionBar</item> </style> themes-v11.xml <style name="AppTheme" parent="AppBaseTheme"