Questions tagged [android-appcompat]

The App Compat Support Library package contains several libraries that can be included in your application. Each of these libraries supports a specific range of Android platform versions and set of features.

android-appcompat
Filter by
Sorted by
Tagged with
403 votes
10 answers
241k views

How do I use DrawerLayout to display over the ActionBar/Toolbar and under the status bar?

I've seen in the new material design Side Nav spec that you can display the drawer over the action bar and behind the status bar. How can I implement this?
Chris Banes's user avatar
  • 31.8k
339 votes
4 answers
67k views

Upgraded to AppCompat v22.1.0 and now getting IllegalArgumentException: AppCompat does not support the current theme features

I've just upgraded my app to use the newly released v22.1.0 AppCompat and I'm now getting the following exception when I open my app. Caused by: java.lang.IllegalArgumentException: AppCompat does not ...
Chris Banes's user avatar
  • 31.8k
284 votes
22 answers
289k views

AppCompat v7 r21 returning error in values.xml?

I'm using Android Studio and when I add compile "com.android.support:appcompat-v7:21.0.0" to my Gradle file, I'm getting a ton of errors: C:\Users\WindowsSucks\AndroidStudioProjects\MMMeds\app\build\...
Michael Garber's user avatar
245 votes
13 answers
108k views

Tab not taking full width on Tablet device [Using android.support.design.widget.TabLayout]

I have setup tabs as UPDATE 29/05/2015 this post. Tabs take full width on my Nexus 4 mobile but on nexus 7 tablet it in center and not cover full screen width. Nexus 7 screenshot Nexus 4 screenshot
Max's user avatar
  • 5,743
241 votes
38 answers
377k views

Cannot resolve symbol 'AppCompatActivity'

I've just tried to use Android Studio. I've created blank project and tried to create Activity which extends AppCompatActivity. Unfortunalty Android Studio "says" that it Cannot resolve symbol '...
Lingviston's user avatar
  • 5,591
222 votes
23 answers
247k views

How to add button tint programmatically

In the new AppCompat library, we can tint the button this way: <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/follow" ...
Stephane Maarek's user avatar
217 votes
10 answers
152k views

Why does Eclipse automatically add appcompat v7 library support whenever I create a new project?

Why does Eclipse automatically add appcompat v7 library support whenever I create a new project? I am creating a simple project whose MainActivity should extend Activity, but it does not. Eclipse ...
Talha Q's user avatar
  • 4,360
216 votes
26 answers
145k views

No resource found that matches the given name: attr 'android:keyboardNavigationCluster'. when updating to Support Library 26.0.0

I've got this issue while updating to the latest Support Library version 26.0.0 (https://developer.android.com/topic/libraries/support-library/revisions.html#26-0-0): Error:(18, 21) No resource ...
Alécio Carvalho's user avatar
191 votes
18 answers
152k views

Remove title in Toolbar in appcompat-v7

The documentation of Toolbar says If an app uses a logo image it should strongly consider omitting a title and subtitle. What is the proper way to remove the title?
timemanx's user avatar
  • 4,513
184 votes
7 answers
63k views

Toolbar and Contextual ActionBar with AppCompat-v7

I am working on using the newly added Toolbar that was introduced in Lollipop and the AppCompat-v7 library. I followed this guide on setting up the Toolbar I noticed that when you invoke something ...
ariets's user avatar
  • 4,248
182 votes
24 answers
88k views

Cannot resolve symbol 'Theme' in styles.xml (Android Studio)

Since today, Android Studio can't find the AppCompat themes in styles.xml, but for example AppCompatActivity in code does get recognized. My Android Studio version is 2.2.2, Build #AI-145.3360264 I ...
FLP's user avatar
  • 2,051
174 votes
19 answers
56k views

Flinging with RecyclerView + AppBarLayout

I am using the new CoordinatorLayout with AppBarLayout and CollapsingToolbarLayout. Below AppBarLayout, I have a RecyclerView with a list of content. I have verified that fling scrolling works on the ...
tylerjroach's user avatar
  • 2,699
170 votes
10 answers
44k views

NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder

There is an issue with the Android appcompat v7 library on Samsung devices running Android 4.2. I keep getting crashes with the following stack trace in my Developer Console: java.lang....
Matt K's user avatar
  • 6,651
165 votes
8 answers
106k views

Material Design not styling alert dialogs

I've added the appCompat material design to my app and it seems that the alert dialogs are not using my primary, primaryDark, or accent colors. Here is my base style: <style name="...
Matthew's user avatar
  • 3,421
164 votes
6 answers
95k views

What's the enhancement of AppCompatActivity over ActionBarActivity?

android.support.v7.app.AppCompatActivity was added into the latest v7 support library as a new feature yesterday. It is said that ActionBarActivity has been deprecated in favor of the new ...
SilentKnight's user avatar
  • 13.9k
160 votes
6 answers
150k views

How to use and style new AlertDialog from appCompat 22.1 and above

I am trying to migrate from default android AlertDialog to the new one included in appCompat-22.1 So far I understand you only have to import android.support.v7.app.AlertDialog package in order to ...
ThanosFisherman's user avatar
141 votes
9 answers
147k views

Creating a SearchView that looks like the material design guidelines

I'm currently in the process of learning how to convert my app to Material design and I'm a bit stuck right now. I've got the Toolbar added and I have made my navigation drawer overlay all the content....
Mike's user avatar
  • 2,593
132 votes
10 answers
82k views

How can I modify ripple color when using ?attr/selectableItemBackground as background?

I've seen some SO questions and they gave some possible methods to achieve what I want. For example: Use colorControlHighlight attribute in styles.xml. Here is my styles-v21.xml: <style name="...
ywwynm's user avatar
  • 11.7k
130 votes
15 answers
166k views

show icon in actionbar/toolbar with AppCompat-v7 21

I tried these - but still do not see the icon like before: getSupportActionBar().setLogo(R.drawable.ic_launcher); getSupportActionBar().setDisplayUseLogoEnabled(true); getSupportActionBar().setIcon(R....
ligi's user avatar
  • 39.2k
130 votes
17 answers
273k views

CardView Corner Radius

Is there a way to make CardView only have corner radius at the top? <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://...
terencey's user avatar
  • 3,292
128 votes
3 answers
63k views

AppCompatActivity.onCreate can only be called from within the same library group

After upgrading to appcompat 25.1.0 I've started getting weird errors. In my code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); I get lint ...
pixel's user avatar
  • 25.6k
112 votes
9 answers
76k views

MenuItem tinting on AppCompat Toolbar

When I use drawables from the AppCompat library for my Toolbar menu items the tinting works as expected. Like this: <item android:id="@+id/action_clear" android:icon="@drawable/...
mariusgreve's user avatar
  • 2,631
105 votes
7 answers
158k views

How do I style appcompat-v7 Toolbar like Theme.AppCompat.Light.DarkActionBar?

I'm trying to recreate the look of Theme.AppCompat.Light.DarkActionBar with the new support library Toolbar. If I choose Theme.AppCompat.Light my toolbar will be light and if I choose Theme....
Liminal's user avatar
  • 1,709
105 votes
1 answer
36k views

android toolbar popupTheme vs theme

Often I see this declaration of Toolbar in layout files: <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" ...
Vitaly Zinchenko's user avatar
102 votes
4 answers
30k views

How do I set a different theme for a Spinner's dropdown?

An example usage: The Spinner is dark themed, but I want the dropdown to be light themed.
Chris Banes's user avatar
  • 31.8k
101 votes
27 answers
78k views

Status bar turns white and does not show content behind it

I am trying out AppCompat on Marshmallow. And I want to have a transparent status bar however it turns white. I've tried a couple solutions but they didn't work for me (Transparent status bar not ...
pt2121's user avatar
  • 11.8k
101 votes
6 answers
104k views

Setting Elevation in XML on AppCompat CardView on Android 5.0

From what I understand, early in the preview stage there seemed to be no way to set elevation in XML only on CardViews without a hack in Java. Now that the official release is out, is there any way of ...
TheLettuceMaster's user avatar
98 votes
11 answers
149k views

Change Toolbar color in Appcompat 21

I am testing out the new Appcompat 21 Material Design features. Therefore I've created a Toolbar like this: <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/...
user2410644's user avatar
  • 3,861
97 votes
5 answers
107k views

How to implement DrawerArrowToggle from Android appcompat v7 21 library

So now that Android 5.0 was released i was wondering how to implement the animated actionbar icons. This library here implements it fine for me but since the appcompat v7 library has it how can it be ...
BigDX's user avatar
  • 3,529
97 votes
3 answers
115k views

Android transparent status bar and actionbar

I've done a few researches on this topic and I couldn't find a complete solution so, step by step and with some trial and error, I finally find out how can we achieve these results: having a ...
GuilhE's user avatar
  • 11.8k
97 votes
9 answers
56k views

Android Lollipop, AppCompat ActionBar custom view doesn't take up whole screen width

So, I just updated my codebase to Lollipop, and I'm having issues with the Action Bar. I'm using AppCompat and ActionBarActivity, and inflating a custom view. It seems that the custom view no longer ...
Stevie Kideckel's user avatar
91 votes
27 answers
270k views

Cannot resolve symbol AppCompatActivity - Support v7 libraries aren't recognized?

I'm trying to figure out why the heck my Android studio isn't recognizing the AppCompat v7 library correctly. The import statement below shows up as gray and says there's no package for support.v7.app....
Mikey Chen's user avatar
  • 2,400
91 votes
5 answers
56k views

How to set ImageButton property of app:srcCompat="@drawable/pic" programmatically?

How to set the ImageButton property of app:srcCompat="@drawable/pic" programmatically? Something like myImageButton.setBackgroundResource(R.drawable.eng2); but the property of app:srcCompat.
Isaac Darlong's user avatar
88 votes
7 answers
60k views

InflateException with FloatingActionButton from Official Design Library

I am getting a bug using the official FloatingActionButton from Google's support design library. Here is my LogCat. android.view.InflateException: Binary XML file line #34: Error inflating class ...
TheLettuceMaster's user avatar
85 votes
15 answers
110k views

You need to use a Theme.AppCompat theme (or descendant) with this activity. Change to Theme.AppCompat causes other error

I use appcompat v22.1.0 in my App and use Toolbar. Everything was fine when I use Theme.AppCompat.Light.NoActionBar. When I start implement AlertDialog, it produce error like this: java.lang....
Rama Bramantara's user avatar
85 votes
24 answers
158k views

Error inflating class android.support.v7.widget.Toolbar?

I am trying to get Material Design for my App by following this method. Whenever I run the App it shows the following error: Error inflating class android.support.v7.widget.Toolbar. I checked ...
AruLNadhaN's user avatar
  • 2,828
80 votes
2 answers
5k views

onPrepareActionMode not called when creating ActionMode

I just finished adjusting one of my apps to the new v22.1.1 support & appcompat libraries, see here and here for more details. When I did some testing, something was off with the ActionModes I'm ...
darksaga's user avatar
  • 2,186
79 votes
11 answers
177k views

Gradle Build Android Project "Could not resolve all dependencies" error

I'm trying to build my first project with Gradle and I think my gradle files and settings are correct. I'm using only one module and Support V4 + AppCompatBar libraries. Project - build.gradle ...
cesards's user avatar
  • 16.1k
79 votes
9 answers
15k views

appcompat-v7 v21.0.0 causing crash on Samsung devices with Android v4.2.2

We just changed our application to use the appcompat-v7 support library in order to take advantage of the support actionbar and support Material themes. Using v21.0.0 of appcompat-v7 (andv21.0.0 of ...
Erik Pedersen's user avatar
74 votes
13 answers
95k views

Make ImageView fit width of CardView

I have a CardView with rounded corners, I want to have an ImageView at the top like shown in the example taken from the material design guidelines below. <android.support.v7.widget.CardView xmlns:...
wow's user avatar
  • 3,889
72 votes
13 answers
140k views

Toolbar navigation icon never set

I'm trying the new Toolbar component and having some trouble with the navigation icon. I want to implement a custom icon for back navigation : In my manifest i set a parent to my activity : <...
grunk's user avatar
  • 14.8k
72 votes
4 answers
24k views

What is the SortedList<T> working with RecyclerView.Adapter?

Android Support Library 22.1 was released yesterday. Many new features were added into the v4 support library and v7, among which android.support.v7.util.SortedList<T> draws my attention. It's ...
SilentKnight's user avatar
  • 13.9k
72 votes
7 answers
21k views

Android - onAttach(Context) not called for API 23

I've updated the SDK to the latest version (API 23) and the onAttach(Activity) method for fragment is deprecated. So instead of using that method, now I'm using onAttach(Context) but this one is not ...
David Rauca's user avatar
  • 1,583
71 votes
2 answers
82k views

Use Tab with new ToolBar (AppCompat v7-21)

I was using SupportActionBar with tabs and a custom ActionBar theme (created with http://jgilfelt.github.io/android-actionbarstylegenerator/), that show the tabs only when the user expands the search ...
Leandro Hoffmann's user avatar
71 votes
6 answers
38k views

Android Selector Drawable with VectorDrawables srcCompat

I'm facing a problem with the new backward compatibility with VectorDrawables. In the Support Library 23.2 was a new feature for backward compatibility with Android VectorDrawables indroduced. I ...
marilion91's user avatar
  • 2,094
70 votes
3 answers
19k views

Android 5.0: how to change recent apps title color?

I'm using AppCompat and my theme is extending Theme.AppCompat.Light.DarkActionBar. When in Android 5 Lollipop and I press the recent apps button, my app appears with a dark title instead of a white ...
Christian Göllner's user avatar
68 votes
11 answers
56k views

Widget.AppCompat.Button colorButtonNormal shows gray

I have values:styles.xml with: <style name="AppTheme.Button" parent="Base.Widget.AppCompat.Button"> <item name="colorButtonNormal">@color/my_color</item> <item name="...
Daniel Gomez Rico's user avatar
67 votes
1 answer
23k views

ComponentActivity vs AppCompatActivity in Android Jetpack Compose

When using Jetpack Compose, by default it extends the ComponentActivity class. But after trying some samples I switched to AppCompatActivity and everything seemed to work fine. So I wonder what the ...
Ebin Joy's user avatar
  • 2,950
67 votes
4 answers
200k views

No resource found that matches the given name '@style/Theme.AppCompat.Light'

I have been on this problem for a couple hours. After downloading a repository from github, the only error in any .xml file is: No resource found that matches the given name '@style/Theme.AppCompat....
Sauron's user avatar
  • 6,509
64 votes
11 answers
31k views

Searchview doesn't work since app compat

Since I implented app compat my searchview doesn't work anymore: Process: com.laurenswuyts.witpa, PID: 26666 java.lang.NullPointerException: Attempt to invoke virtual method 'void android....
Laurenswuyts's user avatar
  • 2,144

1
2 3 4 5
54