android-5.0-lollipop

How to completely disable SELinux in Android L in the init.rc file?

不想你离开。 提交于 2019-12-10 14:22:48
问题 I want to disable SELinux at boot time for Android L or 5. The reason is because my daemon is not begin executed on boot when it should due to SELinux problems. I have the following in my init.rc file: su 0 setenforce 0 service my_daemon /system/bin/my_daemon class main # Also tried: class core (but it didn't make a difference) user root group root However, on boot, I use adb shell to check if SELinux is disabled (using getenforce ) and it returns Enforcing . I want SELinux to be completely

Android Run another application while task lock

送分小仙女□ 提交于 2019-12-10 13:25:50
问题 I set my application as a device owner and the screen is pinning when i call startLockTask() . my problem now when i try to run another application by using this method : Intent i = getPackageManager().getLaunchIntentForPackage("com.example.test"); startActivityForResult(i,Intent.FLAG_ACTIVITY_NEW_TASK); (nothing happen) what i have to do to make it run? Edit : i tried adding dpm.setLockTaskPackages(deviceAdmin, new String[] { getPackageName() ,"com.example.test"}); its not launching too. 回答1

Android 5.0 Lollipop: setColorFilter “leaks” onto other buttons

喜夏-厌秋 提交于 2019-12-10 12:55:32
问题 I am using setColorFilter to set the color filter of ONE of my button. This has been working perfectly until the Android 5.0 Lollipop update. Now, the color filter seems to leak onto my other buttons, even when I close the activity and reopen (it resets if I close the app and reopen). My styles.xml (v21): (same as older except here its parent is Material, before it was Holo) <style name="Theme.FullScreen" parent="@android:style/Theme.Material.Light.NoActionBar.Fullscreen"> <item name="android

Getting TypeNotPresentException followed by ClassNotFoundException or NoClassDefFoundError on All android versions except android L

浪子不回头ぞ 提交于 2019-12-10 12:55:11
问题 I am getting very interesting bug in one of my apps. My app is working fine on android L, But as soon as i try to run it on other android versions, I am getting ClassNotFoundException or NoClassDefFoundError while trying to call web services using Retrofit, even though all those classes are existing and working fine on my android L device. I don't know what's happening right now, app is running in other versions as long as i don't make a Network Request but as soon as i go for Network Request

Open Specific Directory Using Storage Access Framework

时光怂恿深爱的人放手 提交于 2019-12-10 12:55:11
问题 I'm currently able to obtain a file URI by opening the Lollipop file picker using the code below: Intent intent = new Intent(); intent.setAction(Intent.ACTION_OPEN_DOCUMENT_TREE); startActivity(intent); The file picker opens either at the root of Internal Storage or the last directory that I opened. How can I make the file picker show the contents of a specific directory? For example, I might want the file picker to show the contents of the Download folder after launching like in the picture

The getDecorView method return view include navigation bar view on lollipop?

岁酱吖の 提交于 2019-12-10 12:40:01
问题 I use SlidingMenu to implement my slide-in menus. The code is private void initSlidingMenu() { // configure the SlidingMenu menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT); menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setShadowWidthRes(R.dimen.shadow_width); // menu.setShadowDrawable(R.drawable.shadoew); menu.setBehindOffsetRes(R.dimen.slidingmenu_offset); // menu.setFadeDegree(0.35f); menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW); menu.setMenu(R

Designing day chooser like found in clock in android L

偶尔善良 提交于 2019-12-10 12:08:27
问题 I am working on an app where I want to put day chooser like below (which I saw in clock app of android L). Anyone knows how to achieve it? Or is there any library or project implementing this is present? 回答1: Here is an example by radio group which i tried. maybe its helpful for you. just take a look once. your main xml file <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#655EF9" android:orientation="horizontal"> <CheckBox android

get top activity name in Android L

家住魔仙堡 提交于 2019-12-10 11:52:10
问题 I am developing an app which uses getRunningTasks() function to get the top activity name. But getRunningTasks() is deprecated in Android L. Is there any other way to get the top activity name (not package name) in Lollipop. 回答1: Class<?> currentClassName; // Declare Globally Activity activity = (Activity) context;//casting context into activity try { currentClassName = Class.forName(activity.getClass().getName()); //getting the current activity's class name from activity object } catch

How to create a background selector that has Kitkat style for pre-Lollipop, and native one for Lollipop and above?

此生再无相见时 提交于 2019-12-10 11:49:15
问题 This question is short. How do I set a background for buttons and such, that will have the native look&feel of Lollipop (ripple etc...) for Lollipop and above, and Kitkat style for Kitkat and below? I ask this to make this library look better: https://github.com/AndroidDeveloperLB/MaterialPreferenceLibrary 回答1: I think this is possible by declaring the different 'styles' in the corresponding 'values' folder. I think the following link can help: http://developer.android.com/training/material

Lollipop notification background color

别来无恙 提交于 2019-12-10 11:24:50
问题 I can't seem to make my notification use default notification background color: it remains gray where it should be white. At the same time, notification colors are appropriate in kitkat. I have implemented suggestions in this question There doesn't seem to be any effect on what I implement. The values-v21 simply acts as if it weren't there. Naturally, my target sdk is 21. I just can't seem to find the reason for this. The notification is displayed from service using StartForeground . I have