android-4.4-kitkat

Taking advantage of the translucent status bar in Android 4.4 KitKat

与世无争的帅哥 提交于 2019-12-03 05:44:03
问题 When I released my note taking application for Android 4.0 - 4.3 I used a custom action bar color with a custom action bar icon (instead of using the standard light and dark action bars). I would like to make it so on Android 4.4, the status bar will also take on the custom color I am using in my Action Bar (which is #FFD060). Is there a way to easily change my current styles.xml to allow 4.4 to take advantage of this? My styles.xml under my values-v19 folder is as follows: <resources> <style

Android Material Design on KitKat (and lower) devices

南楼画角 提交于 2019-12-03 03:32:09
I'm going to develop an android application in our school as a project. I want to use the new Material Design by Google but i know its only available on Android-L Devices. Jack Underwood has recently released the calendar called "Today Calendar", which is in the Material Style and running on Kitkat and lower Devices. I know that the Actionbar height is a bit bigger than the older one and the navigation drawer toggle has a new style. And so one ... How do i implement that? Currently the Android-L contains the Material Theme which works only on Android-L release. You can build a Material Style

Android 4.4 — Translucent status/navigation bars — fitsSystemWindows/clipToPadding don't work through fragment transactions

╄→尐↘猪︶ㄣ 提交于 2019-12-03 01:43:25
问题 When using the translucent status and navigation bars from the new Android 4.4 KitKat APIs, setting fitsSystemWindows="true" and clipToPadding="false" to a ListView works initially. fitsSystemWindows="true" keeps the list under the action bar and above the navigation bar, clipToPadding="false" allows the list to scroll under the transparent navigation bar and makes the last item in the list scroll up just far enough to pass the navigation bar. However, when you replace the content with

Android WebView (4.4) Converts Custom URL

泪湿孤枕 提交于 2019-12-03 00:47:29
I have an app that heavily uses the Android WebView to display my custom HTML content. The latest Android update (4.4/Kit-Kat/SDK-19) featured a redesigned WebView . One of my users with a Nexus 5 reported a problem where some links cause the app to crash. I ran in the 4.4 emulator and debug into my WebViewClient 's shouldOverrideUrlLoading() method. On all previously tested Android versions (2.2-4.3) the url String passed into the method had my custom url with "/" characters in it. In 4.4 the exact same link now has "\" characters in their place. This doesn't make any sense to me. I load the

Check if gps is on In Kitkat (4.4)

冷暖自知 提交于 2019-12-02 23:39:18
Below kitkat, I get if gps is on with providers list String providers = Secure.getString(context.getContentResolver(), Secure.LOCATION_PROVIDERS_ALLOWED); if (TextUtils.isEmpty(providers)) { return false; } return providers.contains(LocationManager.GPS_PROVIDER); But in kitkat, Secure.LOCATION_PROVIDERS_ALLOWED is deprecated. Javaodc say "use Secure.LOCATION_MODE", Location modes are belows... Secure.LOCATION_MODE_OFF Secure.LOCATION_MODE_SENSORS_ONLY Secure.LOCATION_MODE_BATTERY_SAVING Secure.LOCATION_MODE_HIGH_ACCURACY But i do not know exactly below code is correct. (I do not have kitkat

Android 4.4 Kitkat custom view actionbar not filling the whole width

丶灬走出姿态 提交于 2019-12-02 20:43:43
I am trying to have a Simple actionbar with a custom view, but I get the following result: For demonstration I created a simple xml with a yellow background color which is supposed to take the whole width. Here is the xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/yellow" android:orientation="vertical" > <TextView android:visibility="gone" android:id="@+id/action_save" android:layout_width="wrap_content" android:layout

Bluetooth hands free client volume control

99封情书 提交于 2019-12-02 19:53:25
I have an android device acting as a hands free client device using hfp. Using the following code: I am able to receive a call and the speakers and mic are working as expected. My problem is that I can't seem to control the volume. I tried using the following lines of code to find the correct stream, but none of them seem to work. I tracked the volume command being sent from the phone to the client in the class HeadsetClientStateMachine , line #1822 in the following link: HeadsetClientStateMachine from lolipop case EVENT_TYPE_VOLUME_CHANGED: if (event.valueInt == HeadsetClientHalConstants

bad array lengths, notification manager causes phone crash on 4.4

风格不统一 提交于 2019-12-02 18:23:12
I launched app into BETA testing and multiple users with 4.4 Devices reported that the app causes whole phone to crash, phone pretty much restarts after app launch even though app doesn't even have such permissions. The report I got from testers is as follows: java.lang.RuntimeException: bad array lengths at android.os.Parcel.readIntArray(Parcel.java:820) at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag(INotificationManager.java:348) at android.app.NotificationManager.notify(NotificationManager.java:139) at android.app.NotificationManager.notify(NotificationManager

Taking advantage of the translucent status bar in Android 4.4 KitKat

浪子不回头ぞ 提交于 2019-12-02 18:11:02
When I released my note taking application for Android 4.0 - 4.3 I used a custom action bar color with a custom action bar icon (instead of using the standard light and dark action bars). I would like to make it so on Android 4.4, the status bar will also take on the custom color I am using in my Action Bar (which is #FFD060). Is there a way to easily change my current styles.xml to allow 4.4 to take advantage of this? My styles.xml under my values-v19 folder is as follows: <resources> <style name="AppBaseTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">

Saving to SD card in KitKat

瘦欲@ 提交于 2019-12-02 17:38:58
问题 I am working on an Android tablet application that is being used by law enforcement. I had the tablet backup all the data to an external SD card. I wanted to be able to recover data from the card in case the tablet got destroyed while the police officers were fighting crime. I used this code to store the backup: File file = new File("/mnt/extSdCard/" + NewOrLoad.directoryName + "settings.dat"); try { bW = new BufferedWriter(new FileWriter(file)); Gson gson = new Gson(); String json = gson