android-4.4-kitkat

Reliably get height of status bar to solve KitKat translucent navigation issue

江枫思渺然 提交于 2019-11-28 19:13:49
I am experimenting with the new Android 4.4 translucent navigation bars and would like to set the navigation bar as translucent using the FLAG_TRANSLUCENT_NAVIGATION flag. I only wish the navigation bar (back, home button etc) to be translucent - I want the status bar at the top of the screen to appear normally I.e. NOT translucent. The code I am using to achieve this is: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { Window w = getWindow(); w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); } The problem I

Does Android KitKat allows devices that support Bluetooth LE to act as a peripheral device?

大城市里の小女人 提交于 2019-11-28 18:25:07
Till Android 4.3, an Android device with Bluetooth Low Energy support could only act as a central device. As is given in the Android 4.3 Bluetooth LE docs: Android 4.3 (API Level 18) introduces built-in platform support for Bluetooth Low Energy in the central role and provides APIs that apps can use to discover devices, query for services, and read/write characteristics. With the introduction of Android 4.4 KitKat , can it also behave as a peripheral device now? I couldn't find any documentation of that. If not, then do we have to wait for Android 4.5 for getting the BTLE peripheral mode on

ConsumerIrManage.hasIrEmitter() always returns false (API 19)

僤鯓⒐⒋嵵緔 提交于 2019-11-28 17:41:03
I call ConsumerIrManager.hasIrEmitter() on my LG G2, but it always returns false . According to the documentation on Infrared transmitters : When running on a device that includes an infrared (IR) transmitter, you can now transmit IR signals using the ConsumerIrManager APIs. To get an instance of ConsumerIrManager , call getSystemService() with CONSUMER_IR_SERVICE as the argument. You can then query the device's supported IR frequencies with getCarrierFrequencies() and transmit signals by passing your desired frequency and signal pattern with transmit() . You should always first check whether

MediaPlayer : Should have subtitle controller already set: KitKat

南笙酒味 提交于 2019-11-28 17:25:44
问题 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

Can't access the secondary storage (the external removable micro sd card)

左心房为你撑大大i 提交于 2019-11-28 14:46:50
Please read my question introduction before reading the real question: In Android there are an internal storage and an external storage . Don't be confused, because the internal storage relates to files that are accessible only by the app, and the external storage relates to normal files that can be accessed by all apps and can be found both in the real internal storage card (the phone's sd card) and in the real external storage card (the removable micro sd card). My path of the phone's sd card (the one that you can't remove) is: /storage/emulated/0 . My path of the micro sd card (the one that

Hide status bar in android 4.4+ or kitkat with Fullscreen

纵饮孤独 提交于 2019-11-28 14:14:07
I'm using following code for hiding status bar with full screen purpose: void HideEverything(){ if (Build.VERSION.SDK_INT < 16) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } else { View decorView = getWindow().getDecorView(); // Hide the status bar. int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; decorView.setSystemUiVisibility(uiOptions); // Remember that you should never show the action bar if the // status bar is hidden, so hide that too if necessary. ActionBar actionBar = getActionBar(); actionBar.hide(); } } It shows

Android 4.4 Step Detector and Counter

半腔热情 提交于 2019-11-28 09:12:21
Is there any documentation around Android 4.4 KitKat's (well specifically Nexus 5 for now) step detector and counter APIs? I tried to search a lot but did not find anything. I am planning to try my hands on these new concepts and want to use the API but there's nothing around it on the Internet. I found an example for you, hope it helps in someway, the sensor explanation on the API page is pretty straight forward too.. API Page: http://developer.android.com/about/versions/android-4.4.html#UserInput Blog Post: http://theelfismike.wordpress.com/2013/11/10/android-4-4-kitkat-step-detector-code/

Android4.4 can not handle sms intent with “vnd.android-dir/mms-sms”

╄→гoц情女王★ 提交于 2019-11-28 07:38:24
My application has a button to start default sms activity and it worked perfectly fine all android version except new one, Android 4.4(kitkat) Here is the code: public void onClick(View arg0) { Intent smsIntent = new Intent(Intent.ACTION_VIEW); smsIntent.setType("vnd.android-dir/mms-sms"); smsIntent.putExtra("address", member.getPhoneNumber().trim()); context.startActivity(smsIntent); } And I get error messages 11-08 02:08:32.815: E/AndroidRuntime(14733): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW typ=vnd.android-dir/mms-sms

Global search not working as expected in Android 4.4

我怕爱的太早我们不能终老 提交于 2019-11-28 07:25:51
I've got an application that has two search suggestion providers that both extend SearchRecentSuggestionsProvider , and I've set it up correctly in the manifest file with the following Intent filter and meta-data: <intent-filter> <action android:name="android.intent.action.SEARCH" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable_tv" /> The searcable resource includes android:includeInGlobalSearch="true" , so that should be fine. And I've obviously got a provider there as well: <provider android:name="com.miz.contentprovider

java.lang.NoClassDefFoundError on Android devices with KitKat

最后都变了- 提交于 2019-11-28 04:57:45
问题 I am developing a app and at the moment the app crashes if I use Android KitKat but with Lollipop devices the app runs without crash. The error from LogCat: java.lang.NoClassDefFoundError: mypackage.utils.PlacesAutoCompleteAdapter$1 at mypackage.utils.PlacesAutoCompleteAdapter.getFilter(PlacesAutoCompleteAdapter.java:60) at android.widget.AutoCompleteTextView.setAdapter(AutoCompleteTextView.java:635) at mypackage.PlanRouteActivity.initializeLayout(PlanRouteActivity.java:148) at mypackage