android-5.0-lollipop

Over 10 seconds to load an audiostream with MediaPlayer on Samsung Galaxy S5 Android 5.0

被刻印的时光 ゝ 提交于 2019-12-11 01:52:52
问题 Since the update to Android 5.0 MediaPlayer does not work properly on the Samsung Galaxy S5. The loading time is over 10 seconds after you start an audio stream. Samplecode: MediaPlayer mPlayer new MediaPlayer(); String url = "http://149.13.0.80:80/radio1.ogg"; mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mPlayer.setDataSource(url); mPlayer.prepare(); mPlayer.start(); Same problem if I use MediaPlayer in a service/with prepareAsync()/other audiostreams. Nexus 4 with Android 5 has

Floating action button doesn't appear in kitkat

醉酒当歌 提交于 2019-12-11 01:05:04
问题 I have created a single page app where the floating action button is used to share content from the page. It works flawlessly in android lollipop but when i ran the app on kitkat, it doesn't show. Since the only interactive component is the FAB, the user is left with nothing to do but stare. I ran some search and found that the FAB should work perfectly on kitkat and that there are some issues only when it comes to lollipop(like padding). But, it works just fine in lollipop. Do I have to

SD-Card access API Android for Lollipop?

 ̄綄美尐妖づ 提交于 2019-12-10 21:57:23
问题 In this other question How to use the new SD card access API presented for Android 5.0 (Lollipop)? It is explained how to use the new API to access the "external SDCard". But, how can I know the actual directory returned in the result activity? I mean in function public void onActivityResult(int requestCode, int resultCode, Intent resultData) { if (resultCode == RESULT_OK) { Uri treeUri = resultData.getData(); DocumentFile pickedDir = DocumentFile.fromTreeUri(this, treeUri); ...... How can I

Black background in circular image view in Lollipop

给你一囗甜甜゛ 提交于 2019-12-10 21:43:58
问题 I have used Circular Image View to implement profile image in circular shape with some colored border. The code works perfect on pre-lollipop devices. But, the same code on Lollipop device shows a Black Background behind the rounded image view. Tried many guesses but unable to fix the bug! Please help. Below is the code :- public class CircularImageView extends ImageView { private int borderWidth = 4; private int viewWidth; private int viewHeight; private Bitmap image; private Paint paint;

Error in Manifest.xml when adding PACKAGE_USAGE_STATS [Android Lollipop]

隐身守侯 提交于 2019-12-10 21:27:40
问题 I am trying to use "android.permission.PACKAGE_USAGE_STATS" in my app. Here it says that NOTE: This API requires the permission android.permission.PACKAGE_USAGE_STATS, which is a system-level permission and will not be granted to third-party apps. However, declaring the permission implies intention to use the API and the user of the device can grant permission through the Settings application. It seems that I will need the user to explicitly give my app the permission to give access to the

How to pick image or video on Android L?

て烟熏妆下的殇ゞ 提交于 2019-12-10 20:28:03
问题 I am using below code and it works fine below android 5 . I am able to pick image or video from SD card. Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("video/* image/*"); getActivity().startActivityForResult(photoPickerIntent, 1); However on Android L it shows only videos. tried searching but didn't find anything, any help will be appreciated. 回答1: hi @Mohit you can use this solution for image and video Intent photoPickerIntent = new Intent(Intent.ACTION

Lollipop transitions not working when resuming activity

别等时光非礼了梦想. 提交于 2019-12-10 18:49:31
问题 I have been trying to implement the new Lollipop activity and shared elements transitions during a few days following the steps from Alex Lockwood awesome blog posts. But now I'm facing a bit of a problem. My application uses a DrawerLayout for navigation, but I can also launch some of the activities when clicking other views and buttons. I have set correctly all the Enter, Reenter, Return and Exit transitions for all the activities as well as calling: startActivity(intent, ActivityOptions

Android L devices not sending notification card to Android Wear SmartWatch

可紊 提交于 2019-12-10 18:14:00
问题 I'm trying to send a notification to an Android Wear SmartWatch when a button is clicked. It's working in all devices I have tested, except for the ones with Android L. Does anyone have any idea about what may be the problem? I have even paired the devices with an Android Wear SmartWatch emulator, but, again, it does not work with Android L devices. Below is my button: // the button click listener button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {

WindowEnterTransition Not Affecting Activity Transition

北城以北 提交于 2019-12-10 17:43:33
问题 While windowExitTransition is working as expected I cannot get windowEnterTransition to work: themes.xml <item name="android:windowEnterTransition">@android:transition/explode</item> <item name="android:windowExitTransition">@android:transition/explode</item> MainActivity.java Intent intent = new Intent(MainActivity.this, SubjectActivity.class); startActivity(intent, ActivityOptionsCompat.makeSceneTransitionAnimation(MainActivity.this).toBundle()); Demo 回答1: Are you sure that both activities

addPersistentPreferredActivity on api21

元气小坏坏 提交于 2019-12-10 17:16:48
问题 I'm trying to add persisted activity to intent filter, I am profile owner and device owner and this is verified and I have no security exception but still my activity is not interrupting the call, not sure what to do next ...help please ComponentName adminComponent = new ComponentName(getApplicationContext(), EnforcerDeviceAdminReceiver.class); ComponentName handlerComponent = new ComponentName(getApplicationContext(), HandlerActivity.class); devicePolicyManager