Questions tagged [android-support-library]

The Android Support Library contains backported APIs from newer platforms and APIs that offer utility functionality.

Description:

The Android Support Library includes static "support libraries" that you can add to your Android application in order to use APIs that are either not available for older platform versions or that offer "utility" APIs that aren't a part of the framework APIs. The goal is to simplify your development by offering more APIs that you can bundle with your application so you can worry less about platform versions.

Related tags:

3542 questions
378
votes
14 answers

appcompat-v7:21.0.0': No resource found that matches the given name: attr 'android:actionModeShareDrawable'

When attempting to use the latest appcompat-v7 support library in my project, I get the following…
316
votes
27 answers

In android app Toolbar.setTitle method has no effect – application name is shown as title

I'm trying to create simple application using android-support-v7:21 library. Code snippets: MainActivity.java public class MainActivity extends ActionBarActivity { Toolbar mActionBarToolbar; @Override protected void onCreate(Bundle…
krossovochkin
  • 11,530
  • 7
  • 27
  • 51
239
votes
14 answers

How to make ConstraintLayout work with percentage values?

With a Preview 1 of Android Studio 2.2 Google released a new layout in its support library: ConstraintLayout. With ConstraintLayout it is easier to use a Design tool in Android Studio, but I didn't find a way to use relative sizes (percents or…
Yury Fedorov
  • 12,277
  • 6
  • 44
  • 63
233
votes
2 answers

Difference between Activity and FragmentActivity

I was working on fragments and came across two things Activity and FragmentActivity which are used several times. I want to know that is there any difference between these two, because when I changed Activity with FragmentActivity, it had no effect…
222
votes
36 answers

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 'AppCompatActivity' I have compile…
215
votes
26 answers

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 found that matches the given name: attr …
214
votes
26 answers

Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat

If I run gradle assembleDebug from the command line, I am suddenly getting this error: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dx.util.DexException: Multiple dex files define…
xrd
  • 3,841
  • 5
  • 24
  • 32
182
votes
3 answers

Android.app Fragments vs. android.support.v4.app using ViewPager?

I have a question regarding the Android Support Libraries, Fragments, and as a specific example, the ViewPager class. My intention is to create an app with similar functionality to the sample provided on the Android Developer website…
180
votes
10 answers

Resolved versions for app (22.0.0) and test app (21.0.3) differ

After upgrading to API 22 and support lib revision 22 I'm getting the following warning: Warning:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (22.0.0) and test app (21.0.3) differ. Gradle itself…
copolii
  • 13,331
  • 9
  • 46
  • 76
179
votes
15 answers

Nested Recycler view height doesn't wrap its content

I have an application that manage collections of books (like playlists). I want to display a list of collection with a vertical RecyclerView and inside each row, a list of book in an horizontal RecyclerView. When i set the layout_height of the inner…
176
votes
8 answers

NavigationView get/find header layout

In my NavigationView I have a header layout with id 'viewId' with active buttons. To setup those buttons, I do the following in activity's onPostCreate: final View panel = findViewById(R.id.viewId); panel.setOnClickListener(new…
172
votes
19 answers

How can I access getSupportFragmentManager() in a fragment?

I have a FragmentActivity and I want to use a map fragment within it. I'm having a problem getting the support fragment manager to access it. if (googleMap == null) { googleMap = ((SupportMapFragment) getSupportFragmentManager() …
162
votes
8 answers

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: