android-4.4-kitkat

Android - Get result from change default SMS app dialog

夙愿已清 提交于 2019-11-30 22:36:12
I am working on restoring SMS on KITKAT. Referring to this article I have added the things which are required to set my app as default app for SMS. After adding all required things in manifest file I have write the following code: if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { mDefaultSmsApp = Telephony.Sms.getDefaultSmsPackage(mContext); Intent intent = new Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT); intent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME, mContext.getPackageName()); mContext.startActivity(intent); } The above code shows this dialog but I am

How should we use the mipmap folders added with android 4.4?

只谈情不闲聊 提交于 2019-11-30 21:52:06
I recently installed one more Android SDK to Android Studio, the SDK version 4.4 (API level 19), and after using it with my project, it added a set of mipmap folders in the project's res folder ( res/mipmap ). I neither understand why, or how to use them. I read another question about it here on SO . The answer to it said that: The mipmap folders are for placing your app icons in only. Any other drawable assets you use should be placed in the relevant drawable folders as before. According to this Google blogpost : It’s best practice to place your app icons in mipmap- folders (not the drawable-

Notification API in Android Chrome browser

若如初见. 提交于 2019-11-30 18:04:43
My web application uses the Notification API . I thought KitKat's Chrome browser was supposed to have it, or at least the old webkitNotifications . But both window.Notification and window.webkitNotifications are undefined in my tests in Chrome in Android 4.4. Is there a way to push notifications from the browser to the user when the browser isn't visible in Android 4.4 ? Or do I still have to embed my web app in an Android application to achieve this ? Of course I'm open to other solutions than the HTML5 Notification API, as long as they're practical for my users (no flash). Or to a reliable

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

冷暖自知 提交于 2019-11-30 17:59: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

Content uri crashes camera on Android KitKat

旧街凉风 提交于 2019-11-30 16:06:27
I run into problem while using content uri and FileProvider on Android API 19 (Kitkat). Here's code that I use to open camera on device and record a video: File file = new File(pathname); Uri fileUri = FileProvider.getUriForFile(this, AUTHORITY_STRING, file); Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); startActivityForResult(intent, requestCode); I've tested this code on API's 23-24 and it works just fine, but on API 19 camera closes with RESULT_CANCELED after I starting to take video in camera app. The same thing happening

Android 4.1 to 4.4 KitKat - Enable TLS 1.2 for API

a 夏天 提交于 2019-11-30 16:05:34
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? 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 = {"TLSv1.2"}; final SSLSocketFactory delegate; public Tls12SocketFactory(SSLSocketFactory base) { this.delegate =

Hide Android KitKat 4.4 printing dialog

心不动则不痛 提交于 2019-11-30 15:17:01
问题 I am working on a kiosk app which needs to print. I have the printing functionality working but the problem is it shows a dialog and as a kiosk app we need to keep things simple and limit what users can do. Is there a way to print without showing the dialog? I don't care if it prints to the "default" printer or if it's something I'll need to pass parameters into. I used this for reference: http://developer.android.com/training/printing/html-docs.html 来源: https://stackoverflow.com/questions

android app crash on android 4.4 due to gps permission denial

半世苍凉 提交于 2019-11-30 15:03:11
My android app is crashing when I try to enable GPS on my android 4.4 (Kitkat) . It's been working fine till Android 4.3 . I am using following code to turn on GPS Intent intent = new Intent("android.location.GPS_ENABLED_CHANGE"); intent.putExtra("enabled", true); this.sendBroadcast(intent); In my Log Cat its giving security exception. My LogCat details are as :- 11-27 12:47:37.410: E/AndroidRuntime(3818): Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.location.GPS_ENABLED_CHANGE from pid=3818, uid=10084 11-27 12:47:37.410: E/AndroidRuntime

Hide Android KitKat 4.4 printing dialog

断了今生、忘了曾经 提交于 2019-11-30 13:50:03
I am working on a kiosk app which needs to print. I have the printing functionality working but the problem is it shows a dialog and as a kiosk app we need to keep things simple and limit what users can do. Is there a way to print without showing the dialog? I don't care if it prints to the "default" printer or if it's something I'll need to pass parameters into. I used this for reference: http://developer.android.com/training/printing/html-docs.html 来源: https://stackoverflow.com/questions/20005975/hide-android-kitkat-4-4-printing-dialog

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

早过忘川 提交于 2019-11-30 12:30:18
问题 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