android-5.0-lollipop

5.1.1 notification TextView, the correct way to deal with white text?

狂风中的少年 提交于 2019-12-10 17:06:57
问题 I put a TextView on a custom layout for a notification. The colour of the TextView becomes automatically white. Is this a bug of Android? Because prior to Lollipop, notification background used to be a dark colour, so a white text made sense. Now on Lollipop, the default background is white, so the white text is invisible. Or am I supposed to set text colour explicitely? Putting android:textColor="@android:color/primary_text_light" made the text black, but it is not guaranteed that all

cannot autostart app on boot - got BroadcastQueue: Reject to launch app

◇◆丶佛笑我妖孽 提交于 2019-12-10 16:37:28
问题 I used a popular method to make my app autostart on boot described here: How to start an Application on startup? The issue is that app doesn't start with the following message in logcat: W/BroadcastQueue: Reject to launch app .../10186 for broadcast: App Op 60 What am i doing wrong? PS. Android 5.0.2, phone Asus zenphone 回答1: this problem is caused by "Auto-start Manager", I have same problem. To solve, "Auto-start Manager" > Tab "Lastest Items" or "Downloaded" > Find your App > Change to

How to lock genymotion?

一曲冷凌霜 提交于 2019-12-10 16:05:54
问题 Is there anyway to lock genymotion emulator? To test new notifications in Android 5.0, lollipop, I need to lock the Genymotion. Thank you! 回答1: The question turns out to be useless. I would delete this, but I am not allowed to do so because, this question already has an answer. Sorry I just had to click on power button twice. 回答2: go to settings>security>screen lock and set it to swipe . then press the power button twice. 回答3: Try: adb shell input keyevent 26 . That should emulate a power

MEDIA_PROJECTION_SERVICE not valid in call to getSystemService()

≯℡__Kan透↙ 提交于 2019-12-10 16:03:07
问题 I am trying to develop an application that requires the ability to capture screen content. I'm targeting lollipop to avoid the requirement for root. When trying to get an instance of the MediaProjectionManager via a call to getSystemService() I am getting the following error reported in Android Studio: Must be one of: Context.POWER_SERVICE, Context.WINDOW_SERVICE, Context.LAYOUT_INFLATER_SERVICE, Context.ACCOUNT_SERVICE, Context.ACTIVITY_SERVICE, Context.ALARM_SERVICE, Context.NOTIFICATION

Android API 21 22 datepicker year selection bug?

半城伤御伤魂 提交于 2019-12-10 15:59:34
问题 I've implemented the "calendar view", i.e., lollipop version of Android's Datepicker. There's a difference between Android API 21 & 22 in the year selection of said datepicker when I click on "2015" to change the year: using API21 using API22 I'm using a Nexus 5 simulator. I'm only seeing the current (2015) year entry in API22, whereas in API21, I can scroll through from ~1950 to ~2100. Same code and, as far as I can tell, same simulation settings. I'm wondering if this is just a bug, if

Exception; Cannot set request property after connection is made; occurs on Android lollipop HTC M8

杀马特。学长 韩版系。学妹 提交于 2019-12-10 15:17:03
问题 I am calling a Java Web Service from an Android application using Soap requests. There is a certain method to be called through the app which works fine in Android versions up to Kit Kat in almost all the devices and in Samsung Lollipop devices too, but doesn't work on HTC M8 Lollipop updated device. Following is my code. HttpTransportSE ht = new HttpTransportSE("URL"); SoapObject so = new SoapObject("Namespace", "Method"); try { SoapSerializationEnvelope se = new SoapSerializationEnvelope

android lollipop - setentertransition() for fragment not working properly on exiting

女生的网名这么多〃 提交于 2019-12-10 15:12:17
问题 While replacing fragment, I am using Slide animation available for android lollipop version. It works as expected for this particular replacement, but on pressing back button it first pops back current fragment & then reverse of enter animation (slide out) is executed. private void replaceContentFrameByFragment(Fragment replaceBy, String replaceByFragmentTag) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Slide slide = new Slide(Gravity.BOTTOM); slide.setDuration(1000);

Transparent Navigation Bar for Lollipop app?

北城余情 提交于 2019-12-10 15:08:45
问题 What do I add to themes.xml to change the navigation bar to be more transparent? I can't find documentation for it anywhere. Thanks! 回答1: In your theme add the following line: <item name="android:windowTranslucentNavigation">true</item> Romain Guy has published a nice sample app that uses this API. Maybe it will help. (You might need to refactor some code since the project was originally written using the Android L developer preview). 回答2: Alex's answer is correct. You can use <item name=

Toolbar title textsize decreases on orientation change

﹥>﹥吖頭↗ 提交于 2019-12-10 14:44:54
问题 The Toolbar title textsize gets decreased when I change orientation from portrait to landscape and gets reset when I change back to portrait. The activity in which this happens extends ActionBarActivity which uses getSupportActionBar() . 回答1: Use the below solution: <android.support.v7.widget.Toolbar android:id="@+id/main_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:titleTextAppearance="@style/ToolbarTitle

AlarmManager not fires on time in Android Lollipop

落爺英雄遲暮 提交于 2019-12-10 14:25:26
问题 i'm using this code to set Alarm in Android KitKat and lollipop: AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE); Intent i = new Intent(AlarmService.this, Reciver.class); PendingIntent pi = PendingIntent.getBroadcast(AlarmService.this, 1201, i, PendingIntent.FLAG_UPDATE_CURRENT); Calendar c = Calendar.getInstance(); c.set(Calendar.HOUR_OF_DAY, 9); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); am.setExact(AlarmManager.RTC_WAKEUP, c.getTimeInMillis(), pi); this code is