android-4.4-kitkat

Android Studio 3.0 : canary 6 : android.content.res.Resources$NotFoundException inside Launching activity

旧城冷巷雨未停 提交于 2019-11-30 02:54:31
I update android-studio 3.0 from canary 5 to canary 6 and suddenly My app gives crash on KitKat(API 19) with below stacktrace. The Main2Activity.java:10 line is the first line in my activity onCreate() method. 07-11 13:00:39.523 8913-8913/dcpl.com.myapplication E/AndroidRuntime: FATAL EXCEPTION: main Process: dcpl.com.myapplication, PID: 8913 java.lang.RuntimeException: Unable to start activity ComponentInfo{dcpl.com.myapplication/dcpl.com.myapplication.Main2Activity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f070058 at android.app.ActivityThread.performLaunchActivity

Detecting when system buttons are visible while using 'immersive mode'

只愿长相守 提交于 2019-11-30 02:00:43
I'm currently using immersive mode (API 19) for one of my Activities as follows: getWindow().getDecorView() .setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.INVISIBLE); This hides the system buttons and notification bar until the user swipes for them back. This works fine, however I wish to detect when the user makes the buttons visible again. I've tried a

My service always getting Waited long enough for: ServiceRecord error in Kitkat

拥有回忆 提交于 2019-11-30 00:40:00
I have a background service which is running in kitkat always throwing Waited long enough for: ServiceRecord message in the logcat. But in the previous versions of android my app is running smoothly without any issues. also Sometimes my service is automatically killed in the Kitkat. This is caused by "Serialize running of background services" modification for ActivityServices. Implement #10744011: Serialize running of background services Added some code to the activity manager to keep track of services that are launching and limit the number that can be launched concurrently. This only comes

Android 4.1 to 4.4 KitKat - Enable TLS 1.2 for API

左心房为你撑大大i 提交于 2019-11-29 23:22:51
问题 In trying to disable TLS 1.0, there are KitKat devices needing access to my API. I have tried overriding the default socket factory without success. I have tried converting to okhttp. Still not working. How do I get Android KitKat to connect to my API? 回答1: I had the same issue on pre-lollipop devices. As I'm using Retrofit, here is the solution for OkHttp . Tls12SocketFactory.java : public class Tls12SocketFactory extends SSLSocketFactory { private static final String[] TLS_V12_ONLY = {

How does Android determine if an app has “High Battery Use” under “Recent Location Requests”?

空扰寡人 提交于 2019-11-29 23:16:16
As of Kitkat (4.4) Android reports that my app is "High battery use". I use Network Location as well GPS. If I disable GPS, then it seems the app gets marked as "Low battery use". I'm wondering if there are any tips to using GPS while keeping the "Low battery use" label. Perhaps if you poll infrequently enough - or is it hardcoded to GPS = battery killer? EDIT: I understand that changing those parameters will conserve battery life. My question was more of whether Android will recognize these attempts at battery life conservation or will it simply brand my app as high power usage simply because

MediaPlayer : Should have subtitle controller already set: KitKat

不打扰是莪最后的温柔 提交于 2019-11-29 21:19:40
I am having an odd issue where my audio file sometimes plays and sometimes does not play. The catch is that when it decides to not play, the DDMS gives me an: E/MediaPlayer﹕ Should have subtitle controller already set Because this is one-to-one with the music not playing, I have determined that this is probably the issue... If the music is not playing and I hit the volume button it begins to play. If I wait about 30 seconds of no-play, it begins to start again (not looping). Whats going on here? I am on KitKat using player = new MediaPlayer(); AssetFileDescriptor afd = null; try { afd =

ADT 22.3 (android 4.4) - getting error “After scene creation, #init() must be called”

只谈情不闲聊 提交于 2019-11-29 21:13:31
After installing the new ADT (22.3.0.v201310242005-887826) which supports Android 4.4 (KitKat), I keep getting the error as shown here: An internal error has occurred In the list of errors, I see multiple items of "RenderPreview", and when I click on any of them, I see: An internal error has occurred. After scene creation, #init() must be called When testing the new ADT on another computer, I can't see this error appearing there. This is very weird. Why do I get those errors, and what can I do to fix it? I've created a bug report . Until it gets fixed, set the API version in the UI preview to

Translucent system bars and content margin in KitKat

混江龙づ霸主 提交于 2019-11-29 19:24:09
I'm trying to take advantage of the new KitKat translucent system bars, to get a full screen image in the background of my app. I'm having problems figuring out the right settings to get the behaviour I want. Right now I have a ViewPager with three Fragment s each one composed of a RelativeLayout containing an ImageView (for the background image) and a TextView for the content. What I'm after is to have the content fit fully in the portion of the screen available for interactions, and the image to take the whole visible portion of the screen. If I just use android:Theme.Holo.Light.NoActionBar

MediaPlayer randomly stops on Android 4.4 (19)

大城市里の小女人 提交于 2019-11-29 12:52:24
问题 My app is streaming audio fine on all devices except Nexus 5. On Nexus 5, the MediaPlayer randomly stops playing. Not sure if the changes with respect to Loudness (http://developer.android.com/about/versions/android-4.4.html#Multimedia) in 4.4 has broken something. Is anyone else noticing this issue? Seems to be happening to some users, but I'm unable to reproduce on my own Nexus 5. UPDATE: So I was able to reproduce the issue on my Nexus 5. It seems to actually be happening near the end of

VP8 Encoding Nexus 5 returns empty/0-Frames

社会主义新天地 提交于 2019-11-29 12:49:46
I'm trying to encode my camera feed to VP8. The problem is: when I get the frame from the output buffer, the byte array is always different size but all entries are 0. Here's the code where I grab the frame and print it: while (true) { try { encoderIndex = mEncoder.dequeueOutputBuffer(encoderOutputInfo, timeOut); } catch (Exception e) { e.printStackTrace(); } switch (encoderIndex) { case MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED: // something break; case MediaCodec.INFO_OUTPUT_FORMAT_CHANGED: // something else break; case MediaCodec.INFO_TRY_AGAIN_LATER: // something completely different break;