android-5.0-lollipop

How to create ripple effect in simple layout

你离开我真会死。 提交于 2019-12-17 08:09:54
问题 How can I have a ripple effect in a simple linear/relative layout when touching the layout? I've tried setting the background of a layout to something like: <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight" > <item android:drawable="@android:color/white"/> </ripple> However I'm only seeing a plain white background and no ripple effect when touching the layout. What am I doing wrong? Edit:

How to import RecyclerView for Android L-preview

China☆狼群 提交于 2019-12-17 07:16:11
问题 Trying to use the new RecyclerView from the support library. I downloaded the 20 update for the support library using the SDK manager. I've added the jar file to the libs folder - and added to build path - no luck using the RecyclerView. Tried to use also the gradle dependency according to Android Developer's API - not sure if this is the right place to look - this page is related more to AndroidTV : com.android.support:recyclerview-v7:20.0.+ Cannot gradle sync the project. Any ideas? 回答1: I

Android 5.0: how to change recent apps title color?

為{幸葍}努か 提交于 2019-12-17 07:13:19
问题 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 title in the ActionBar. When I'm inside the app everything looks fine. What can I do to change the title color in the recent apps view? EDIT : just figured out that if I use a darker colorPrimary , the title becomes white. I still need a way to force the white title with the original color. 回答1:

Alternative to getRunningTasks in Android L

我与影子孤独终老i 提交于 2019-12-17 06:39:26
问题 It's been well documented that getRunningTasks is now deprecated in Android L. I used this to get top activity and this was an important feature of my app. Though not complete, a new solution in Android L has been promised by a Google Employee. The solution states: "for L we do plan to have a new solution that will address some of the existing use cases of getRecentTasks(): we hope to expose the system’s internal usage stats service in a new and expanded form that is available to third party

Android 5.0 (L) Service Intent must be explicit in Google analytics

偶尔善良 提交于 2019-12-17 06:33:10
问题 My code worked in <5 but in Android 5.0 I'm running into an issue that I don't quite understand. 10-23 10:18:18.945: E/AndroidRuntime(8987): java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.google.android.gms.analytics.service.START (has extras) } My code works, even now, on 4.4.4 and below. So what do I need to do? I'll post relative code below. Also, during my googling I found this post about java.lang.IllegalArgumentException: Service Intent must be

Elevation on Android Lollipop not working

左心房为你撑大大i 提交于 2019-12-17 06:13:30
问题 I am trying to make use of the elevation property in the latest Android Lollipop preview release. I set the targetSdk to 21 and the theme to Material. Next i added a background shape to a TextView and set the elevation to 8dp but the TextView is not showing any signs of a shadow. That is on a Nexus7 running the Lollipop preview. Is there anything else i have to consider? Here is the layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res

Error inflating class and android.support.v7.widget.CardView

僤鯓⒐⒋嵵緔 提交于 2019-12-17 05:07:54
问题 I want to use CardView in my project, but when I run my application, I get the following error. I'm using Eclipse . Error: Error inflating class and android.support.v7.widget.CardView The graphical view of my xml file says 'The following classes could not be instantiated: - android.support.v7.widget.CardView (Open Class, Show Error Log) See the Error Log (Window > Show View) for more details.' Please help. This is the layout for my fragment where I have used CardView <FrameLayout xmlns

CardView layout_width=“match_parent” does not match parent RecyclerView width

情到浓时终转凉″ 提交于 2019-12-17 04:47:41
问题 I have a fragment with contains a RecyclerView with layout_width="match_parent": <android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin"

Toolbar and Contextual ActionBar with AppCompat-v7

岁酱吖の 提交于 2019-12-17 03:21:25
问题 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 that will bring up the contextual ActionBar (such as highlighting text for copy/pasting), that it will push the Toolbar down on the page. You can see what I am talking about in the image at the bottom of the page: So, essentially, I set it up like this. I have the Toolbar defined in an xml file that

GLES10.glGetIntegerv returns 0 in Lollipop only

若如初见. 提交于 2019-12-17 03:09:39
问题 This piece of code used to work in my Nexus 7 2012 KitKat: int[] maxSize = new int[1]; GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSize, 0); In KitKat I can obtain the max pixel value correctly, but after the upgrade to factory image Lollipop this snippet of code causes problem as it only returns 0. The logcat showed this output when it reached this method: E/libEGL﹕ call to OpenGL ES API with no current context (logged once per thread) I already have android:hardwareAccelerated="true"