FAQ Database Discussion Community


IllegalArgumentException on Android Maven Install

android,maven,android-support-library
I am getting the following exception when attempting a "mvn install" on an Android project. [INFO] UNEXPECTED TOP-LEVEL EXCEPTION: [INFO] java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl; [INFO] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122) [INFO] at com.android.dx.dex.file.DexFile.add(DexFile.java:161) [INFO] at com.android.dx.command.dexer.Main.processClass(Main.java:685) [INFO] at...

Import new Android Design Support library

android,android-support-library,android-design-library
Hi i'am trying to import the new android support library like this com.android.support:support-design:22.0.0 but i got this error after sync the gradle : failed to find

Android Support v4 version 22.2.0 cannot resolve FragmentActivity

android,android-support-library
Apparently after upgrading Android Support Library to version 22.2.0 now I cannot add these: import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; I tried these and none are working: File->Invalidate Caches and Restart Sync Gradle Files Change Build Tools Version Could this be a bug? I put back...

CollapsingToolbar not working with not-so-tall content

android,android-support-library,android-design-library,androiddesignsupport
I'm pretty sure this is a bug, so I'm asking for a workaround. My layout is like: <CoordinatorLayout> <AppBarLayout> <CollapsingToolbarLayout> <ImageView/> <Toolbar/> </CollapsingToolbarLayout> </AppBarLayout> <android.support.v4.widget.NestedScrollView/> <!-- content here --> </CoordinatorLayout> I'm retrieving content from the web, and I don't know how tall it'll be - might be few lines, might...

Are all versions of the android support library given the same revision number?

android,android-support-library
I see that the current revision of the Android Support Library is 21.0.3: Does that mean that the most recent revision of each version of the support library (v4, v7, v13, etc.) has a revision number of 21.0.3? In other words if I want to update my build.gradle file to...

Android Studio Android Library with resources

android,android-support-library,android-library
I want to create Android Library with jar file and resources without sources. Dependency structure : Android Library Sample : depends on support v4, v7 and some jars included SampleApp depends on Android Library Sample and v4, v7 support I can generate jar file by compiling Android Sample Library, but...

Exception in plugin Android Support

java,android,android-studio,android-manifest,android-support-library
Suddenly when I was running my android application project, Android Studio shows an error balloon of Internal Error Then my manifest suddenly got errors saying java.lang.RuntimeException: Activity name cannot be empty. I tried disabling the Android Plugin and restarting it back again but no use. I also have error on...

Gradle not using latest version of the support library?

android,android-studio,gradle,android-support-library,recyclerview
I've been using the android.support.v7.widget package -- specifically the RecyclerView class (among others but this is where the problem is). It was working fine until earlier today it randomly seems to default to an earlier version of the package now. I say that because: When I try calling myRecyclerView.addOnScrollListener(myScrollListener), myRecyclerView.getChildAdapterPosition(myView)...

Toolbar resizes til softkeyboard when editing EditText

android,android-fragments,android-edittext,android-support-library,android-toolbar
This is my first question here, after 2 hours of searching a similar case I couldn't find one therefor this post. The problem is that I have an activity with a toolbar (v7 support toolbar) and a navigation drawer. This all works perfectly. The main activity has a fragment container,...

NullPointerException: with ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference

android,android-actionbar,android-support-library
strong textI get this nullPointerException on runtime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference code from mainActivity: package com.example.vasilis.spangreek; import android.app.ActionBar; import android.app.Activity; import android.content.res.Configuration; import android.content.res.TypedArray; import android.os.Bundle; import android.support.v4.widget.DrawerLayout; import...

Android Design Support Library

android,android-support-library,material-design
I have found this after a google search about the android design support library. It states: "Android Design Support Library brings a number of material design components that are compatiable [sic] with all Android 2.1 or higher devices." I am wondering if this means that the android design support library should...

RecyclerView adapter is showing blank cardview

android,android-support-library,recyclerview,android-cardview,recycler-adapter
I have a nasty issue on sub api21 devices. I am using a RecyclerView.Adapter adapter to inflate android.support.v7.widget.CardView. The idea is that the cards will only add information that is present to the cards. If no information is present the card wont show at all. So I create these cards...

material-dialog lib, error: No resource found that matches the given name 'android:Theme.Material.Light.Dialog.Alert'

android,eclipse,android-support-library,material-design
I am trying to import this material-dialog library. Getting this error: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.Dialog.Alert'. Getting it in file: values-v21/styles.xml. I am using Eclipse and I have imported android-support-v4.jar in libs folder. What could be the issue here? ...

Should I replace ActionBarActivity with AppCompatActivity?

android,android-actionbar,android-support-library
I am following an Android lesson and under the Support Android 2.1 and Above section it is said my Activity should extend the ActionBarActivity class to support Action Bar on API-7 onwards. However, documentation also says that this class is deprecated and I should use AppCompatActivity instead. I'm confused here,...

DrawerLayout is not a sliding drawer

android,xml,android-support-library
I have looked through all other answers to this question, but still couldn't solve this error: app:id/drawerLayout) is not a sliding drawer I get error on closeDrawer line: mDrawerLinear = (LinearLayout) findViewById(R.id.drawerLayout); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerList = (ListView) findViewById(R.id.drawer_list); mDrawerLayout.closeDrawer(mDrawerLinear); I am setting content this xml> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"...

What is CoordinatorLayout?

android,android-support-library,android-design-library
Just had a look at the demo app of new Android support design library. It's provided by Chris Banes on github. Throught the app, CoordinatorLayout is used Heavily. Also, many of the support design libabry classes like FloatingActionButton, SnackBar, AppBarLayout etc. behaves differently when used inside CoordinatorLayout. Can someone please...

onKeyDown is not called after updating support library

android,android-support-library
Recently I have updated android support library to version 22.1.0 compile 'com.android.support:support-v4:22.1.0' compile 'com.android.support:appcompat-v7:22.1.0' I am overriding method onKeyDown and found that it is not called after updating library. If I go back to previous version of library it works fine. Is there any other method to override in new...

Support library (v4 vs v13)

android,android-support-library
I'm new in Android development and I'm considering if I have to use the support libraries or not. The min SDK is 16 and target SDK is 22. On Android docs, there is a note that is a a bit confusing to me, that is Note: If you are including...

Android Design Support Library And Material Design Backwards Compatibility?

android,android-support-library,material-design,appcompat,android-design-library
I'm new here, so bear with me! I'm sorta confused about the new Design Support Library (and how one implements support libraries), and I had a two questions: I'm confused about how support libraries are implemented. Is it something as simple as saying 'if the OS version is below version...

Custom RatingBar tinting API < 21 with support library 22.1.1

android,android-support-library,android-drawable
I'm using the support library 22.1.1. My goal is to tint a custom RatingBar to avoid having to include multiple images in my APK. The tinting is correctly applied on API 22, but not on API 19. I'd like it to work on API >= 16. Note that I'm trying...

v7 getSupportActionBar() is throwing NullPointerException

java,android,nullpointerexception,android-support-library
I'm launching a new activity (TVMPDFActivity) from my root activity. I'm using Android Annotations, so this is how I'm launching the Activity: TVMPDFActivity_.intent(this.getActivity()).start(); TVMPDFActivity is a subclass of PDFPreviewActivity which is a subclass of ActionBarActivity. A NullPointerException is being thrown from onCreate in PDFPreviewActivity when I simply try to GET...

Android CardView And Eclipse ADT

android,android-support-library,eclipse-adt,android-cardview
Im using Eclipse and have a trouble with cardview. error: No resource identifier found for attribute 'cardCornerRadius' in package I already add latest android-support-v7-cardview.jar to libs folder and build path. My CardView layout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"...

Error when inflating CardView

java,android,android-5.0-lollipop,android-support-library,android-cardview
I am using a RecyclerView to hold a list of CardViews. On my device running Lollipop 5.0.2, the app runs fine and the list displays the data correctly. however, on other pre-lollipop devices such as one running 4.4.2, I get the following error: android.view.InflateException: Binary XML file line #2: Error...

How to add a gradient to a ImageView nested in a CollapsingToolbar

android,imageview,android-support-library,material-design,collapsingtoolbarlayout
I'am working on an Android app with material design. I have a detail view with a CollapsingToolbarLayout and a ImageView (works fine so far). Unfortunately the title is not readable if there is a bright image. You can find a screenshot of this issue under this link https://www.dropbox.com/s/jvdbep89yt5yrg5/device-2015-06-17-231603.png?dl=0 (I am...

How does Android support library work with target SDK level?

android,android-studio,android-support-library,appcompat,appcompat-v7-r22.1
I understand that I can use support libraries to add elements that aren't natively available. However, does the newest SDK version (Lollipop, for example) use these support libraries as well, or does it use native elements? E.g. if I run the app on a Lollipop device, will it use native...

How to change the library locale as well when I change the app locale in android

android,localization,locale,android-support-library,android-location
I created an app that utilize the google map , and I use the google play service library in android. The problem is the library does not change the locale when I change the locale in my app. But it use the locale of the phone device. Here is how...

FragmentTabHost tabs overlap tabcontent

android,android-fragments,android-support-library
I'm using a FragmentTabHost (Support library, Android) to load my fragments into tabs. However, I see that the tabs are hosted over my tabcontent. But I want my tabcontent to be laid below the tabs. How is this possible? I have search but couldn't find anything related to this. ...

NoClassDefFoundError when using TabLayout

android,android-layout,android-support-library
I wanted to check out the new TabLayout from the Android Design Support Layout. The usage of the TabLayout is just TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout); in Java and <TabLayout android:id="@+id/tabLayout" android:layout_width="match_parent" android:layout_height="wrap_content" /> This is my build.gradle file (simplified a little bit): apply plugin: 'android' android { compileSdkVersion 22...

attribute insetForeground has already be defined

android,android-support-library
after updating to the new com.android.support:design:22.2.0 I got this error: "attribute insetForeground has already be defined" keep in mind that i'm using @romannurik ScrimInsetsFrameLayout.java ...

Using Support Design Library in Eclipse

android,eclipse,android-support-library,floating-action-button,android-design-library
I'm working on a project that unfortunately hasn't been migrated to Android Studio yet. I want to utilize the floating action button in Google's new support.design library but I can't manage to get it included in my project. I updated the support libraries in the Android SDK Manager. First I...

Cannot cast to LayerDrawable anymore (after upgrading v7)

android,android-support-library,appcompat-v7-r22.1
I'm using last version of the support libraries, 22.1.1. I used to go like: mRatingBar = (RatingBar) getActivity().findViewById(R.id.rating); LayerDrawable layer = (LayerDrawable) mRatingBar.getProgressDrawable(); but after upgrading it crashes at line 2 with a ClassCastException: android.support.v4.graphics.drawable.DrawableWrapperHoneycomb cannot be cast to android.graphics.drawable.LayerDrawable at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:973) at...

Is adding a colored icon to a transparent toolbar possible?

android,android-actionbar,android-support-library,android-toolbar
Is it possible to add a circular icon like this to a transparent Toolbar (styled like an action bar), and maintain its coloring? EDIT: this icon will be right aligned on the toolbar, similar to where you would see the three dot menu icon in most apps. ...

Appcompat, compatibility, and support libraries for Lollipop if minimum SDK = 14

android,android-support-library,appcompat,android-compatibility,maven-sdk-deployer
We have an existing Android app that supports API Level 8 up to 18. We used compatibility libraries 19.1.0. Now we are changing/upgrading to: Minimum SDK = 14 Target = android-22 Now given that there are v4, v7, v13 support, compatibility, and appcompat libraries in different versions, I'm not sure...

Using my Lollipop theme (on Lollipop)!

android,android-5.0-lollipop,android-support-library
I had my app looking pretty nice using the new Lollipop tools. I decided backwards compatibility is important, so I switched all my Fragments,actionBar imports to the support library. Now (understandably) I can't use my lollipop theme. Is there a way to use different action bars for different themes? I...

(Design Support Library) CollapsingToolbarLayout — Toolbar not getting pinned on collapse

android,android-support-library,android-toolbar,androiddesignsupport,collapsingtoolbarlayout
I'm having trouble integrating the Design Support Library into my application. For some reason, the toolbar collapses with the CollapsingToolbarLayout, and does not leave it pinned like in the Cheesesquare example by Chris Banes. https://github.com/chrisbanes/cheesesquare I didn't do anything different to my layout. In fact, I replaced my styles with...

cannot access DialogStyle

android,android-support-library
After updating android-support library to 22.2.0 project stopped compiling. error: cannot access DialogStyle class file for android.support.v4.app.DialogFragment$DialogStyle not found Consult the following stack trace for details. com.sun.tools.javac.code.Symbol$CompletionFailure: class file for android.support.v4.app.DialogFragment$DialogStyle not found Can't find how to work around this issue. Previously used version was 22.1.1...

FloatingActionButton example with Support Library

android,android-support-library,floating-action-button,android-design-library
Recently, I read these posts: Android Design Support Library Android Support Library, revision 22.2.0 FloatingActionButton But, none of them give me a detail example about creating a new FloatingActionButton. So hard to understand, I asked this question. Can anyone give me an example about it? Any help much be appreciated....

Whether it Library org.garret.prest?

java,android,eclipse,android-support-library,decompiler
I discovered this when decompiler an application, no one knows what it's kind of a Library? I found it in an Android app, because I want to look to try the library ...

Android Studio - getChildFragmentManager / android-support-v4

fragment,android-tabhost,navigation-drawer,android-support-library
I cannot solve the problem with android-support-v4. All "Extras" including "Android Support Repository (11)" and "Android Support Library (21.0.3)" - Installed. I was trying a lot of ideas which I found, but nothing help. I am AndroidStudio beginner. Here is my builg.gradle: apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion...

Xamarin Forms Android Error: Please install package 'Android Support Library'

xamarin,monodroid,android-support-library,appcompat,xamarin.forms
I recently uploaded my project to Git, and used a auto-generated Xamarin/Windows/MacOS/VisualStudio .gitignore file. I did a lot of work and testing on iOS, but now I'm coming back to android but upon building the Project.Droid version, I get the following errors: Error 11 Please install package: 'Android Support Library'...

Difference between an AppCompat view and a normal Android view

android,android-view,android-support-library,appcompat
What is the difference between an AppCompat view component and a standard/default view component? For example, the difference between an AppCompatEditText, and an EditText, or between an AppCompatButton and a Button. Looking at the developer docs for android.support.v7.widget, the AppCompat view components are described as "tint aware", but is this...

Retain getChildFragmentManager navigation stack after removing and re-adding fragment

java,android,android-fragments,android-support-library
I have activity: `<RelativeLayout> <FrameLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent"/> <Button/> <Button/> </RelativeLayout>` Inside this container, depending on which button pressed appear FragmentA or FragmentB. These fragments are containers for nested child-fragments. I.e. in each fragment contains its own navigation stack. In onCreate of Activity I instantiate these 2 fragments: fragmentA =...

Unable to style action mode when using Toolbar

android,android-support-library,material-design
I'm not sure if this is a bug or somehow I'm not using the new Toolbar class properly. I'm able to successfully theme the ActionBar directly using one of the available themes. This also allows me to theme the ActionMode. Everything works perfect as expected. Here is how I'm doing...

Adding toolbar to activity causes NoClassDefFoundError

android,android-actionbar,android-support-library,android-toolbar,android-actionbaractivity
I'm Trying to add a toolbar to an activity. But I'm getting this error: java.lang.NoClassDefFoundError: android.support.v7.app.ActionBarActivityDelegateBase$2 at android.support.v7.app.ActionBarActivityDelegateBase.ensureSubDecor(ActionBarActivityDelegateBase.java:304) at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:225) at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102) at...

Error when using any Android Design Support Library Elements

android,android-support-library,android-design-library
Error inflating anything from the design support library xml <android.support.design.widget.FloatingActionButton android:layout_width="wrap_content" android:layout_height="wrap_content"/> build.gradle dependencies { compile 'com.android.support:support-v4:22.2.0' compile 'com.android.support:design:22.2.0' compile 'com.android.support:multidex:1.0.1' compile 'com.android.support:support-v13:22.2.0' compile 'com.android.support:appcompat-v7:22.2.0' project build.gradle buildscript { repositories { mavenCentral() }...

Design Support Library v22.2 “UNEXPECTED-TOP-LEVEL EXCEPTION”

android,gradle,android-support-library,build.gradle,android-design-library
I decided to use some cool stuff Google just released in their support design library. Everythyng goes fine when I import the library and when I sync the project with Gradle files. But it gives me an error when I compile the project. I don't know if i have too...

How I can remove the unnecessary top padding of the Navigation view?

android,android-support-library,android-design-library,navigationview
There's an unnecessary top padding between the header and the first item shown in this picture. How it can be removed? you can find the source code here: https://github.com/chrisbanes/cheesesquare...

The import android.support.v7.app.ActionBarDrawerToggle cannot be resolved

android,android-support-library,actionbardrawertoggle
I am trying to use the ActionBarDrawerToggle and getting the error: The import android.support.v7.app.ActionBarDrawerToggle cannot be resolved It got no problem importing the v4 type but as I understand, it is deprecated and doesn't function as I want to. Further more, I got no issue with importing other v7 classes...

DrawerLayout: Not part of android.jar?

android,navigation-drawer,android-support-library
By Using DrawerLayout (by using android.support.v4.widget.DrawerLayout)from Android support library, we are achieving the navigation drawer functionality in our Android app. But this is the ONLY thing an app needs from android.support.v4. Is there a way or a roadmap in future exist, where DrawerLayout becomes part of android.jar(like Fragment who migrated...

ScrollingViewBehavior for ListView

android,android-listview,android-support-library,android-recyclerview
I have two activities using AppBarLayout with a Toolbar and TabLayout from support library 22. The layout of both is pretty similar: A Toolbar at the top, below it TabLayout, below it a ViewPager containing 3 Fragments. The first activity's Fragment has a RecyclerView, the second activity's Fragment is using...

Snackbar in Support Library doesn't include OnDismissListener()?

android,android-support-library,android-design-library,android-snackbar
I'd like to implement the new Snackbar included in the latest Design Support Library, but the way it is offered seems counter-intuitive for my, and I assume many others', use. When the user does an important action, I want to allow them to undo it via the Snackbar, but there...

When using RowsFragment, does ObjectAdapter.setPresenterSelector do anything?

android,android-5.0-lollipop,android-support-library,tv,android-tv
I'm using RowsFragment with an ObjectAdapter and I spotted the method ObjectAdapter.setPresenterSelector. However, I've already set my PresenterSelector using RowsFragment.setPresenterSelector, so I'm not sure what ObjectAdapter.setPresenterSelector does. Does it do anything?

Error with appcompat module

android,android-support-library,appcompat
My problem was Ide didnt detect Theme.AppCompat.Light <style name="mytheme" parent="Theme.AppCompat.Light"> Then i decide to add appcompat module to my project! When i add appcompat module to my project its return this error when compile it : Error:android-apt-compiler: [android-support-v7-appcompat] ERROR: Unknown option '--output-text-symbols' Error:android-apt-compiler: [android-support-v7-appcompat] Android Asset Packaging Tool Im using...

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

android,android-support-library
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 is more forgiving, but Android Studio, not so much. I have no dependencies declared with 21.0.3 ... is one...

Drop shadow for Floating Action Button

android,android-support-library,shadow,floating-action-button
I'm creating my own floating action button. For this I'm using a RippleDrawable (created by me) and a ShadowDrawable (also created by me). The problem I'm facing is that my ShadowDrawbale does not cast perfect shadow for the respective button. The code for my ShadowDrawable is as follows: public...

getFragmentManager on android.support.design.widget.NavigationView

android,navigation-drawer,android-support-library,android-design-library
On the new support design library I cant replace current fragment, check my code below. Although the Toasts are working and displaying on the screen. I'm getting empty screen whenever I'm going to click on any item on the navigation drawer private void setupDrawerContent(NavigationView navigationView) { navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { @Override...

Paste from AccessibilityService works in API22 does not work in API17

android,android-support-library
When I run my code on API22 it works just fine, pasting the "Testing Testing" in my required EditText in the app that initiated the AccessibilityEvent. But when I run it on API 17, it does not work. It copies the data to clip but is unable to paste it....

Why does the method count goes up not down when switching from android-support-v4 to v13

android,android-support-library
When switching from support library v4 to v13 I expected the method count number to go down because now all the methods which are in the SDK version 13+ don't have to be in the support jar anymore. Well I checked what happens when I exchange the v7 against the...

AppCompatActivity actionbar and device menu button

android,android-support-library,appcompat-v7-r22.1
I am using AppCompatActivity with ActionBar style @style/Widget.AppCompat.Light.ActionBar. When I create menu from activity, than overflow menu button appear in ActionBar, if device don't have hardware menu button. But, on device Xiaomi Redmi Note, overflow button apear in ActionBar, and device has own hardware button. This is some configs: compileSdkVersion...

How to dynamically change from Hamburger icon to Up icon in Appcompat 22

android,android-support-library,android-toolbar,appcompat-v7-r22.1
I would like to change a Hamburger icon in ToolBar to Up icon ("<") given a user input within a same Activity. This is my ToolBar: <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" android:minHeight="?attr/actionBarSize" app:titleTextAppearance="@style/ToolbarTitle"> on MainActivity#onCreate Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); if (toolbar != null) { setSupportActionBar(toolbar); }...

Why is SupportMapFragment is null (support back to API 9)

android,android-fragments,google-maps-android-api-2,android-support-library,supportmapfragment
I have created a Github project that demonstrates the issue. git clone https://github.com/anujgoyal/buggymap.git I realize there are existing questions, but very few of them have distilled the program down to this level. In addition I have a hard requirement to use the android.support.v4.app.Fragment class, not FragmentActivity, not MapFragment. Note that...

Where to find older versions of Android Support Library?

android,teamcity,android-support-library
I am setting up CI server using TeamCity and I get a Gradle bust where it cannot find an Android Support Library that one of the modules uses. This is the error: ##teamcity[buildProblem identity='-1301271058' description='org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.support:support-v4:21.0.3.|nSearched in the following locations:|n https://jcenter.bintray.com/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom|n...

How to set shared checkable behavior across all groups in NavigationView?

android,navigation-drawer,android-support-library,material-design,navigationview
I've created two groups with unique ids (I need a divider) and they both have checkableBehavior set to single. This allows multiple items from different groups to be checked at once, and that's exactly what I'm trying to avoid. I'd like to have one item checked at maximum, across all...

For what devices do I use this android.support.v4.os classes?

android,android-support-library
In Android support library docs about android.support.v4.os: Support android.os classes to assist with development of applications for android API level 4 or later. "Or later" means API 5,6,7 etc.? But a device running API 22(latest at the moment) will automatically support older devices? I don't quite understand it - it...

Android ClassNotFoundException for Support v7 TestActivity

android,android-activity,android-support-library
I have an app that I just received a crash report for. I don't have the full stack trace with me right now, but it was from ActivityLoader.performLaunchActivity. The class it is trying to launch is android.support.v7.widget.TestActivity. I certainly never try to load this activity anywhere in my app. The...

How to set a custom color for the popup of action items, including of the overflow menu?

android,android-actionbar,android-support-library,popupmenu,overflow-menu
Background I'm working on adding some material design style for an app, so I've chosen a different color for the action bar and status bar. The problem For this, the theme of the app is of "Theme.AppCompat.Light.DarkActionBar", and added this to hide the action bar as I need to handle...

setsupportactionbar() throws error

android,toolbar,android-support-library
I tried following the steps for displaying a drawer above the action bar but below the status bar. The steps found here: display over the ActionBar/Toolbar and under the status bar? But after implementing the code, the following error was thrown: error: cannot find symbol method setSupportActionBar(Toolbar) I've searched on...

Rendering problems in Android Studio v 1.1 / 1.2

android,android-support-library
When I add android.support.v7.widget.Toolbar or another android.support.v7.widget.* there are rendering problems. But Support Library is up to date. And I complied in dependecies properly. I can import them in MainActivity.java What is the problem?...

android design library gradle null pointer exception

android,android-support-library,android-design-library
I'm trying to add android.support.design library to my project: All the interesting things in my gradle file: dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:design:22.2.0' compile 'com.android.support:support-annotations:22.0.0' compile 'com.android.support:support-v13:22.1.1' compile 'com.android.support:recyclerview-v7:22.1.1' compile 'com.android.support:cardview-v7:22.1.0' } I'm getting Error:Android Gradle Build Target: java.lang.NullPointerException When removing...

RecyclerView is always null

android,android-fragments,android-support-library,android-recyclerview
I am trying to implement a RecyclerView in my app, but I can't make it work at all. It throws NPE and I can't find out why, because I've done everything according to official Google tutorials. Logcat output: 04-26 23:04:41.823 22356-22356/com.example.app W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41670d88) 04-26...

Android support library v4 dialog fragment

android,android-support-library
What I am trying to do ? I have got this fragment which loads up an xml. within that xml I have an image button and it should display a dialog message. This is the code for the fragment ; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.view.LayoutInflater; import android.view.View;...

._android-support-v4.jr cannot be read

android,eclipse,android-support-library
I import my older project, and i give this error: Description Resource Path Location Type Archive for required library: 'C:/Users/Janko/workspace/gb android zdrojáky/girlsapp/client/GirlBom/libs/._android-support-v4.jar' in project 'GirlBom' cannot be read or is not a valid ZIP file GirlBom Build path Build Path Problem i try this -> link but dont help me....

Android Design Support Library Secondary Drawer Menu

android,navigation-drawer,android-support-library,android-design-library,androiddesignsupport
I've switched to the official Google Design Support Library. Now, I want to use a secondary menu with a divider like this: But as Android is using the Menu Inflater I have no idea what to do now. I can add a second group, but then the items have the...

How to fix unexpected white line in bottom of CardView in Android

android,android-layout,android-support-library,android-cardview
I have a CardView like this, but there is a white line at the bottom where there shouldn't be. Any idea what could be causing this? Here is the code! <android.support.v7.widget.CardView android:id="@+id/card_view" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="5" app:cardCornerRadius="4dp" android:layout_margin="5dp"> <ListView android:id="@+id/home_list_listview" android:layout_width="match_parent" android:layout_height="match_parent" android:divider="@null" android:dividerHeight="0dp"...

Toolbar+SearchView+textSelection = bad position of text selection bar

android,android-support-library,searchview,android-toolbar,textselection
Background I'm trying to theme my app to have more material design look, and as such, I have a toolbar that's being set as the actionBar of the activity. I have a SearchView in it that allows to search items of the listView below. The problem Thing is, you can...

How to create a simple divider in the new NavigationView?

android,navigation-drawer,android-support-library,android-design-library,navigationview
Google introduced the NavigationView in the Design Support Library version 22.2.0 with which you can create a drawer very easily using a menu resource. How can I create a simple divider line between two items? Grouping the items didn't work. Creating a sub items section does create a divider line,...

Upgraded to AppCompat v22.1.0 and now onKeyDown and onKeyUp are not triggered when menu key is pressed

android,android-support-library,onkeydown,onkeyup
I've just upgraded my app to use the newly released v22.1.0 AppCompat and now onKeyDown and onKeyUp are not triggered when menu key is pressed. The other keys correctly trigger onKeyDown and onKeyUp, but when i press the menu key nothing happens. If I downgrade to v22.0.0 everything returns to...

How to customize the color of the caret of the expanded-search-action-item?

android,android-actionbar,android-support-library,searchview,caret
Background I've made a few adjustments to my tiny app, so that it would follow the material design guidelines better. The problem I have a search action item, and the action bar is blue, but when clicking the search action item, I can barely see the caret (where the text...

Gradle error after add android support design library

android,android-support-library,android-design-library
I'm getting this error after add compile 'com.android.support:design:22.2.0' to my gradle file: .../app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/res/values/values.xml with this message Error:(1) Attribute "insetForeground" has already been defined. I have this on my build.gradle file: ` compile 'com.android.support:design:22.2.0' compile 'com.android.support:cardview-v7:22.2.0' compile 'com.android.support:recyclerview-v7:22.2.0' compile 'com.google.android.gms:play-services-base:7.5.0' compile...

How to add Tabs to ActionBar for Swipe Tabs?

android,android-activity,android-actionbar,android-support-library,android-tabs
I wanna create two swipe tabs with ActionBar. This is my code: import android.app.ActionBar; import android.app.FragmentTransaction; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import com.rastari.salar.mymetarialbank.R; /** * Created by Salar on 9/5/2015. */ public class AccountsActivityChart extends FragmentActivity implements ActionBar.TabListener { ActionBar actionBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_chart);...

Android - App crashes on some devices at same line

android,android-activity,android-support-library,android-version
I published my Android app on Google Play and I get many reports about crashes from some devices. At first I thought that this is a SDK version problem, but after I update, it still happens. Here is the report log that I get: java.lang.NoSuchMethodError: android.view.Window.setStatusBarColor at stefanmaimon.milab.blenders.MainActivity.onCreate(MainActivity.java:81) at android.app.Activity.performCreate(Activity.java:5451)...

Control Smooth scroll in recycler view

android,android-5.0-lollipop,android-support-library,recyclerview
I am using Recyclerview with CardView. I am aware how to control speed on list view. But not for Recyclerview. I searched a lot in found class name SmoothScroll. How to use that? I have no Idea! Right now Recyclerview by default scroll is fast. Edit: Right now RecyclerView is...

When using the CoordinatorLayout my ScrollView has an incorrect size

android,android-support-library,material-design,android-scrollview,android-design-library
I'm using a ScrollView in a layout, and am attempting to use the new CoordinatorLayout from the design support library. My layout file looks like this: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"...

Exception raised during rendering: View android.support.v7.widget.Toolbar not created with the right context

android,android-layout,android-studio,android-support-library
I'm receiving this error message in the Android Preview Designer as "Rendering Problems". I'm using API 22 to render and migrating to the new API support v4:22.1+ and v7:22.1+. Rendering Problems Exception raised during rendering: View android.support.v7.widget.Toolbar not created with the right context Scenario: Using Android Studio v1.2RC Render API...

Support Library Froyo to Lollipop

android,android-support-library
How, Which and Where do I need to implement the support-libraries in order to get the app working on older android-versions. What do I need to implement for a app running on Lollipop as well as on Froyo?

Is this a bug in Android support design Library?

android,android-support-library,floating-action-button
I just started to use the new Deisgn library from Google : 'com.android.support:design:22.2.0' I use the FloatingActionButton and I have a small issue between Android below 5.0 and over 5.0. Watch the screenshot : Android 4.4 : Android 5.0 : As you can see, on Android 4.4, there is a...

Error after updating the Android.Support Library v7 AppCompat to the 21.0.3 version

android,visual-studio-2013,xamarin,android-support-library
after updating the Android.Support Library v7 AppCompat to the 21.0.3 version I've got this errors: 1>C:\Program Files (x86)\MSBuild\Xamarin\Androi\Xamarin.Android.Common.targets(236,2): error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file C:\Users...\AppData\Local\Xamarin\Android.Support.v4\21.0.3\embedded\classes.jar doesn't exist. 1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(236,2): error XA5207: Please install package: 'Android Support...

LocalBroadcastManager only with support library?

android,broadcastreceiver,android-support-library,localbroadcastmanager
In my Android app I want to broadcast some notifications. In the MainActivity I register BroadcastReceiver which handles messages but as I understand it is not recommended to use global BroadcastReceiver if I do not want to send messages out of the app. Instead of this a LocalBroadcastManager or Handler...

Android AppCompat Toolbar does not respond to touching action items

android,android-layout,android-support-library,android-actionbar-compat,android-toolbar
I'm following these instructions to implement an AppCompat toolbar in my Android app. I am using AppCompat version 7:22.0.1 Also, I'm using this toolbar in addition to the actionBar (it's not replacing the actionBar, as I see in many other examples). The toolbar shows up, and it even shows the...

Toolbar button gravity for extended toolbar

android,android-layout,android-support-library,android-toolbar
Im trying to set the position of my back navigation icon in my extended toolbar as follows: <android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_height="wrap_content" android:layout_width="match_parent" app:theme="@style/Toolbar" android:minHeight="@dimen/action_bar_height" app:buttonGravity="top" android:gravity="top" android:background="?attr/colorPrimary" /> Checking the sources of...

Add android library project to Android project in Android Studio

java,android,maven,gradle,android-support-library
I have Android project (main) that has a dependency on Android-library (library) project. I have that in Eclipse where I added library project, but now I want to use Android Studio where I cant find similar option. Is it possible to do it by Gradle where I build library project...

AppBarLayout and Toolbar invisible on Android 4.x

android,android-support-library,android-design-library
I am using the new AppbarLayout and Toolbar from the v22 design support library. But they appear invisible on 4.x devices. Is this a known issue? How do I fix it? Here's my XML: <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"...

support Toolbar Versus support search View

android,android-support-library,material-design
i have a problem with support Toolbar. when i collapse search View. All Toolbar items (ProgressBar in my case) is set To View.VISIBLE , And nor in SearchView nor in SupportMenuItem is no listener when search View finishes collapsing, to manualy return my items Visibility. my Toolbar.xml <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar"...

Android use AppBarLayout instead of Toolbar

android,android-activity,toolbar,android-support-library,appcompat
I am using a normal AppCompat Toolbar in my project. In one of my fragments I want to use the AppBarLayout toolbar and TabLayout instead of the normal Toolbar. How can I switch between those two toolbars? I tried inflating the AppBar Toolbar but it just puts it below the...