android-4.4-kitkat

How to completely exit from Immersive full screen mode?

允我心安 提交于 2019-12-04 01:22:01
I would like to implement a button to enable/disable the immersive full screen mode. I'm using those methods but the showSystemUI only shows quickly and hide again... How to completely exit from immersive mode? My methods: // This snippet hides the system bars. @SuppressLint("NewApi") private void hideSystemUI() { try{ // Set the IMMERSIVE flag. // Set the content to appear under the system bars so that the content // doesn't resize when the system bars hide and show. mDecorView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM

Android 4.4 http api bugs?

时光毁灭记忆、已成空白 提交于 2019-12-04 00:26:46
问题 I decided to start testing my app with Android 4.4 and noticed that the Android HTTP connection APIs are much stricter than before? I have never had this issue and I assume it is some type of bug. I'm connecting to SHOUTcast broadcasts that contain the particular icy header response. Has anyone seen this issue? How can I get around it? URL used for this test: http://50.117.121.162:80 Logcat of exception: 11-01 23:47:57.299: E/ConnectHelper(3081): java.net.ProtocolException: Unexpected status

How to set status bar tint color in layout/style XML?

喜欢而已 提交于 2019-12-03 22:58:49
I'm using the windowTranslucentStatus in my app theme. Now, also want to tint the status bar to match my ActionBar. Currently I'm using the SystemBarTint library, which is mostly fine except of one problem: When the application launches, the OS shows a themed mockup layout as a splash image during the actual inflation. At that stage, there is no status bar tinting yet. It looks like that (Took me 5 times to capture this screenshot during app launch): Only after the activity is fully loaded the tint is applied. This is a problem for me and I'm looking for a way to somehow show the full branding

android camera and gallery not working in nexus 5

ぃ、小莉子 提交于 2019-12-03 21:58:11
In my application I use camera and gallery to upload the selected image to server. it's working fine till 4.4.2, but in 4.4.4 nexus5 both camera and gallery don't work. my camera part is in a Fragment .If I try to take a photo using the camera or pick a photo using the gallery I get "please retry" message as per my code. camera action code: String path = Environment.getExternalStorageDirectory() + "/appname"; File photopath = new File(path); if (!photopath.exists()) { photopath.mkdir(); } try { Intent captureIntent = new Intent( MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult

How do I specify and add a custom printer in an Android app?

微笑、不失礼 提交于 2019-12-03 21:49:36
I'm creating an app for Android. Part of the desired app functionality is that the user can select a special printer (let's just call it Transfer Printer) which will pass on the document-to-be-printed to a process running on an external server. What steps do I need to take to add a custom printer to the list of printers in the Android print panel, accessible from the Print option of the Overflow menu? It is desirable to use the existing Android print panel functionality rather than, for example, an additional Share option in the App Selector because of user experience considerations; it won't

How can I use O_DIRECT or O_SYNC on an external SD card with Android KitKat

陌路散爱 提交于 2019-12-03 20:52:19
I work for a company that makes an SD memory card that includes a hardware encryption engine. We interact with the encryption module by writing/reading to a special file. Starting with KitKat, the O_DIRECT flag does not seem to be supported on the external SD card. Without O_DIRECT or O_SYNC support, the OS will returned cached data when we read the encryption engine's response from the SD card (via our special file). Is there a procedure to open a file on the eternal SD card, read/write, with either O_DIRECT or O_SYNC ? If you have root-access to your phone you can write a 1 to /proc/sys/vm

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

痞子三分冷 提交于 2019-12-03 18:42:12
问题 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. 回答1: 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

Custom View constructor in Android 4.4 crashes on Kotlin, how to fix?

拟墨画扇 提交于 2019-12-03 17:02:13
问题 I have a custom view written in Kotlin using JvmOverloads that I could have default value. class MyView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyle: Int = 0, defStyleRes: Int = 0 ) : LinearLayout(context, attrs, defStyle, defStyleRes) All works fine in Android 5.1 and above. However it crashes in 4.4, since the constructor in 4.4 doesn't have defStyleRes . How could I have that supported that in 5.1 and above I could have defStyleRes but not in 4.4,

Automatically revert to previous default SMS app

浪子不回头ぞ 提交于 2019-12-03 16:26:17
I have an app that requires temporary access to the device's SMS. In KitKat and above, this access is only granted to the default SMS app, so I'm using: Intent intent = new Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT); intent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME, getPackageName()); startActivity(intent); This brings up a dialog asking the user if they let my app become the default SMS app. So far so good. Problem is, once my app completes its operation, I have to ask the user again, if they want to restore their previous app as their default SMS app. I'd like a way to avoid

Android Material Design

半世苍凉 提交于 2019-12-03 15:25:27
Does the new Android Material Design support old version of android such as 3.0 or 2.1? if it supports how would it look like? as a real material design or just as old design? I am about to update my app with material design theme so is there anybody who already has done this? As far as material design as a concept goes, yes you can do it all today. Some aspects of it would require a lot more work on your part (for example, imitating the new action bar design guidelines), whereas some parts are a lot more simple (e.g. the new guidelines for content spacing and colors). There are also some