android-5.0-lollipop

Styling the popup menu in Android 5.0

China☆狼群 提交于 2019-12-17 22:19:06
问题 I'm making my app ready for Android 5.0, I'm using the latest compatibility library, here is what my style looks like. <resources> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/theme_accent</item> <item name="colorAccent">@color/theme_accent_secondary</item> </style> <style name="AppThemeDark" parent="Theme.AppCompat"> <item name="colorPrimary">@color/theme_accent</item> <item name="colorAccent">@color/theme_accent_secondary</item> <

SQLite Database gives warning automatic index on <table_name>(column) After upgrading Android L

£可爱£侵袭症+ 提交于 2019-12-17 22:17:53
问题 I have upgraded my Nexus 7 with Android 5.0 Lollipop, Before that my application going well with SQLite Database but now Whenever I execute any type of query, It gives me log cat error like: 12-09 12:37:04.942: E/SQLiteLog(13041): (284) automatic index on area(server_id) 12-09 12:37:04.942: E/SQLiteLog(13041): (284) automatic index on account(area_id) 12-09 12:37:04.942: E/SQLiteLog(13041): (284) automatic index on staff_visit(account_id) 12-09 12:37:04.942: E/SQLiteLog(13041): (284)

How to remove border/shadow from lollipop buttons

柔情痞子 提交于 2019-12-17 21:49:00
问题 The buttons looks fine for api < 21. However, the +21 versions creates this border or shadow that is shown on the image below. How do I get rid of it without changeing the hole theme, but setting a style variable? It might be more clear on this colored image. There is some kind of border around the buttons. My buttonssstyle is defined like this: <style name="buttonTransparent" parent="Base.TextAppearance.AppCompat.Button"> <item name="android:background">#00000000</item> <item name="android

example of AlwaysOnHotwordDetector in Android

我只是一个虾纸丫 提交于 2019-12-17 21:46:07
问题 Can someone provide an example of how to use the new AlwaysOnHotwordDetector class in Android? I'd like to build an app, that when the app is running in the background, can detect a hotword like "next", or "back", or "pause". 回答1: Unless I have a huge blind spot, I don't think third-party applications can make use of this API. Its strange that AlwaysOnHotwordDetector (and related classes VoiceInteractionService etc.) have been granted public access. If you are building a privileged app , look

Google Play Services in Genymotion on Lollipop (Android 5.0)

强颜欢笑 提交于 2019-12-17 21:46:04
问题 Can't seem to find any mention of support of Google Play services on Android 5.0 API 21 (Lollipop) in what seems like the canonical thread on the subject or google. Does anyone have any insight on this? I'm familiar with the practice of downloading the gapps package and installing, have it working on Kitkat and Jellybean just fine. Both of those install packages seem to hose the VM if I try them on 5.0 With the recent Genymotion upgrades I was hoping they'd be beefing up for compatibility,

Android 5.0 - ProgressBar cannot be displayed over a Button

耗尽温柔 提交于 2019-12-17 19:58:14
问题 I think the title is pretty explicit about my problem... So here is my layout : <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button_action" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Login" /> <ProgressBar android:id="@+id/progress_bar" android:layout_width="50dp" android:layout_height="50dp" android:layout_centerInParent="true"/> </RelativeLayout> On android SDKs < 21, no problem

How to center action menu on toolbar

情到浓时终转凉″ 提交于 2019-12-17 19:17:25
问题 I have an application with a split action bar loading an action menu. I changed the actionbar for the new toolbar and replaced the split actionbar by an other toolbar used in standalone mode : Toolbar toolbarBottom = (Toolbar) findViewById(R.id.toolbarBottom); toolbarBottom.inflateMenu(R.menu.ab_one_cam); As specified in the documentation the action menu is pin to the right of the toolbar : But i would like the icons to be centered on the toolbar , like it was on the split actionbar : How can

How to get running application activity Name in android 5.0(L)?

感情迁移 提交于 2019-12-17 18:37:51
问题 I am using the following code to get the current running activity name in android. ActivityManager am = (ActivityManager) aContext .getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.RunningTaskInfo> alltasks = am .getRunningTasks(1); ComponentName componentInfo = alltasks.get(0).topActivity; componentInfo.getClassName(); System.out.println("Current:"+componentInfo.getClassName()); This is working fine in all the versions below android 5.0 . But in Android 5.0 it always

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

半世苍凉 提交于 2019-12-17 18:35:41
问题 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

How to change system navigation bar color

落爺英雄遲暮 提交于 2019-12-17 17:48:10
问题 In guidelines of Android 5.0 , the navigation bar seems customizable: http://www.google.com/design/spec/layout/structure.html#structure-system-bars How can I change the navigation bar color? I would like to use a white style. Screenshots: Edit: In my resources, I tested the style: <item name="android:navigationBarColor" tools:targetApi="21">@android:color/white</item> But the buttons are white. I would like the same renderer as the second image. 回答1: Starting from API 27, it is now possible