android-4.4-kitkat

Android status bar tints from kitkat to lollipop

ぃ、小莉子 提交于 2019-12-02 04:01:33
I'm trying to implement the nice status bar for my app and have successfully achieved this on kitkat. This is the xml I'm using <?xml version="1.0" encoding="utf-8" ?> <resources> <style name="AppTheme" parent="AppTheme.Base"/> <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="android:windowBackground">@color/colorPrimary</item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">false</item> <

Setting onClickListeners for buttons in scenes programmatically

拟墨画扇 提交于 2019-12-01 19:25:43
I have 2 layouts which contain the same buttons layout_1.xml <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button_1" android:text="button2" android:background="@android:color/black" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout> and layout_2.xml <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button_1" android:text="button2" android:background="@android:color/white" android:layout_width="wrap_content" android

Setting onClickListeners for buttons in scenes programmatically

99封情书 提交于 2019-12-01 19:16:54
问题 I have 2 layouts which contain the same buttons layout_1.xml <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button_1" android:text="button2" android:background="@android:color/black" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout> and layout_2.xml <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button_1" android

Set Android immersive full screen mode in manifest

a 夏天 提交于 2019-12-01 18:32:04
问题 In the new KitKat there is immersive full screen mode that can be used like this: To provide your app with a layout that fills the entire screen, the new SYSTEM_UI_FLAG_IMMERSIVE flag for setSystemUiVisibility() (when combined with SYSTEM_UI_FLAG_HIDE_NAVIGATION) enables a new immersive full-screen mode. http://developer.android.com/about/versions/android-4.4.html#UI I'm wondering if it is possible to set this mode for an Activity or full application in the manifest? 回答1: There is no way to

EACCES Permission Denied in Kitkat while writing to SD card

邮差的信 提交于 2019-12-01 12:44:20
i am trying to copy file to micro sd card from internal storge of mobile and getting error Eacces. I searched alot but now where found clear solution. Is is possible or not to copy in non rooted / rooted Kitkat devices. Here is my code: package jss.kitkatfile; import android.os.Bundle; import android.os.Environment; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class MainActivity extends AppCompatActivity { @Override

How do I print a WebView using KitKat 4.4 print API via reflection?

余生长醉 提交于 2019-12-01 11:33:40
I need to support printing on KitKat devices but my target SDK is 13 (changing is not an option). Specifically I need to print a webview. This is the API for printing a webview: http://developer.android.com/training/printing/html-docs.html It's an old one but printing is kind of usefull so this could be good to work correctly. (Without reflection ;)) A better way to work with devices version. No try-catch needed, just need to add some messages before the return or you just hide the button/menu/... depending on the same condition. @TargetApi(Build.VERSION_CODES.KITKAT) private void

EACCES Permission Denied in Kitkat while writing to SD card

旧城冷巷雨未停 提交于 2019-12-01 10:45:10
问题 i am trying to copy file to micro sd card from internal storge of mobile and getting error Eacces. I searched alot but now where found clear solution. Is is possible or not to copy in non rooted / rooted Kitkat devices. Here is my code: package jss.kitkatfile; import android.os.Bundle; import android.os.Environment; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import java.io.File; import java.io.FileInputStream; import java.io

DrawerLayout not working with Android 4.4 & SurfaceView

主宰稳场 提交于 2019-12-01 08:17:13
Today I had one of those "android" moments again, which left me absolutely clueless. I have an app which consists of a DrawerLayout, which includes a RelativeLayout as container for a SurfaceView (surfaceViewContainer) and a second ViewGroup (subclass of RelativeLayout) as navigation. When the app starts, in onCreate I inflate the layout and add a SurfaceView to the surfaceViewContainer. On a Samsung S2 with 4.1.2 and a S3 with 4.3 everything works fine, I can see the SurfaceView drawn and I can open and close the drawer, by swipe gesture or home button. Then I tested on Android 4.4 with a

How do I print a WebView using KitKat 4.4 print API via reflection?

删除回忆录丶 提交于 2019-12-01 07:47:26
问题 I need to support printing on KitKat devices but my target SDK is 13 (changing is not an option). Specifically I need to print a webview. This is the API for printing a webview: http://developer.android.com/training/printing/html-docs.html 回答1: It's an old one but printing is kind of usefull so this could be good to work correctly. (Without reflection ;)) A better way to work with devices version. No try-catch needed, just need to add some messages before the return or you just hide the

can't open file chooser in WebView Android 4.4.2 using WebChromeClient

£可爱£侵袭症+ 提交于 2019-12-01 07:16:31
In my webview by clicking "Choose File" button In samsung 7 inch tablet I want to open a File Browser, but I can't open this in Android Version 4.4.2 . So can u plz help me for this? Here is my Code. WebViewDemo.java package com.example.webviewdemo; import java.io.File; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.content.res.Configuration; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.os.Parcelable; import android.provider.MediaStore; import