android-7.0-nougat

In Android 7, ContentResolver's method-openAssetFileDescriptor(vCardUri, “r”) returns AssetFileDescriptor having declaredLength as -1

我怕爱的太早我们不能终老 提交于 2019-12-01 09:40:01
问题 In Android 7, getContentResolver().openAssetFileDescriptor(vCardUri, "r") returns AssetFileDescriptor having declaredLength as -1 returned by getDeclaredLength() . Trying to export the contacts as vcards into vcf file. The code I have tried is as follows Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey); AssetFileDescriptor fd = resolver.openAssetFileDescriptor(uri, "r"); FileInputStream fis = fd.createInputStream(); byte[] b = new byte[(int)fd

Android 7.0 ble scan no result

寵の児 提交于 2019-12-01 08:54:48
When I start ble(Bluetooth Le) scan for seconds, then stop scan. Then start, then stop... after about 5-8 Loops, the start action will be No effect ,this means no scan record can be received. 1.This condition only appears on Android 7.0 or above(7.1.1); 2.I have tried two scan method: BluetoothAdapter.startLeScan() and Scanner.startScan(), no difference . private void scanToggle(final boolean enable) { mScanHandler.removeCallbacks(scanTask); if (enable) { TelinkLog.i("ADV#scanner#startScan"); scanner = mBluetoothAdapter.getBluetoothLeScanner(); scanner.startScan(null, settings, scanCallback);

Xamarin error System.DllNotFoundException: /system/lib/libsqlite.so on Android 7.0

我怕爱的太早我们不能终老 提交于 2019-12-01 06:36:27
I get this exception whenever I try to create a SQLite.Net.SQLiteConnection in android 7.0 any idea how to fix it? I'm using these nuget pacakges: <packages> <package id="ExifLib.PCL" version="1.0.1" targetFramework="monoandroid6" /> <package id="Microsoft.Bcl" version="1.1.10" targetFramework="monoandroid43" /> <package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="monoandroid43" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="monoandroid6" /> <package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="monoandroid6" /> <package id="SQLite.Net-PCL" version

Android: ADT doesn't recognize the format of Nougat logcat

烈酒焚心 提交于 2019-12-01 05:20:41
问题 I have an "old" ADT: Eclipse IDE for Android Developers 23.0.2.1259578 adtproduct connected to a Nougat Pixel C. ADT doesn't succeed to read properly the format of logcat as shown on this screenshot: There was no problem before the upgrade to Nougat, aka with Marshmallow. Is there anything to do (except abandoning ADT...)? 回答1: Issue : -Eclipse is no longer supported by Android -Android Nougat/7 this broke (new LogCat protocol I read) Eclipse fix (custom build) Credit goes to: Romano in https

Xamarin error System.DllNotFoundException: /system/lib/libsqlite.so on Android 7.0

风流意气都作罢 提交于 2019-12-01 04:06:50
问题 I get this exception whenever I try to create a SQLite.Net.SQLiteConnection in android 7.0 any idea how to fix it? I'm using these nuget pacakges: <packages> <package id="ExifLib.PCL" version="1.0.1" targetFramework="monoandroid6" /> <package id="Microsoft.Bcl" version="1.1.10" targetFramework="monoandroid43" /> <package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="monoandroid43" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="monoandroid6" /> <package id=

Android RTL issue in API 24 and higher on locale change

天涯浪子 提交于 2019-12-01 01:27:18
I was trying to change locale of app at runtime. It is working fine in Andorid below API level 24. But in API level 24 or greater the layout direction is not changing according to locale. Below is the code to change the locale at runtime. I have used LocaleHelper class as below public class LocaleHelper { private static final String SELECTED_LANGUAGE = "Locale.Helper.Selected.Language"; public static Context onAttach(Context context) { String lang = getPersistedData(context, Locale.getDefault().getLanguage()); return setLocale(context, lang); } public static Context onAttach(Context context,

Google Play Services on Genymotion emulator with Android 7

二次信任 提交于 2019-11-30 16:01:29
I have purchased Genymotion with the goal to have a simulation with Android 7.0 and Google Play. Android 7.0 runs fine on Genymotion, but I am not able to install Google Play on it. Google Play works fine for Android 6.0 and below - I was able to find the sources (Flashes) that must be installed additionally for using Google Play in Genymotion. Does someone know how to install Google Play on an Android 7.0 Device with Genymotion? Updated answer Since Genymotion 2.10, you are able to install Google Play Services within ease without dealing with zip files. You now have a 1-click installer

Android N crashes in TextAppearanceSpan

二次信任 提交于 2019-11-30 14:01:34
问题 Since upgrading my Nexus 5X to Android N, I have the following crash when using EditText: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x101009b a=1} at android.content.res.TypedArray.getColorStateList(TypedArray.java:528) at android.text.style.TextAppearanceSpan.<init>(TextAppearanceSpan.java:65) at android.text.style.TextAppearanceSpan.<init>(TextAppearanceSpan.java:45) at android.widget.Editor$SuggestionsPopupWindow.setUp(Editor.java

Android 7 intent extras missing

旧城冷巷雨未停 提交于 2019-11-30 09:36:47
Does anyone know if there are any changes to how Android 7.0 (Nougat) handles intent extras compared to Android 6.0 (Lollipop)? Long story short: my app works as intended on all versions from 4.1(16) to 6.0(23) but crashes on android 7.0(24)! The app creates a pending intent with an intent to a custom broadcast receiver which has extras. However, on android 7 none of the extras are present in the intent received by the broadcast receiver. MainActivity.java Intent intent = new Intent(context, PollServerReceiver.class); // TODO: Remove after DEBUGGING is completed! intent.putExtra("TESTING1",

Detect connectivity changes on Android 7.0 Nougat when app is in foreground

霸气de小男生 提交于 2019-11-30 08:33:17
问题 Nougat changed the way it handles CONNECTIVITY_CHANGED intents (basically ignoring it, forcing devs to use the job scheduler) so this leaves me wondering: If I have an app that is in the middle of retrieving some data (and I checked if the phone was online at the time I did the request but the user is on the move and the phone connects to a different wifi access point, for example) and it fails, how do I detect that the connection has been restored and I cam retry fetxhing the data? So in