android-7.0-nougat

Android N not sending android.net.conn.CONNECTIVITY_CHANGE broadcast?

拥有回忆 提交于 2019-12-29 04:41:28
问题 I have defined a receiver in a sandbox Android N application: <receiver android:exported="true" android:name="com.sandboxapplication.NetworkReceiver"> <intent-filter> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> </intent-filter> </receiver> It's rather simple: public class NetworkReceiver extends BroadcastReceiver { private static final String TAG = NetworkReceiver.class.getName(); @Override public void onReceive(Context context, Intent intent) { Log.i(TAG, "Received Network

Android N not sending android.net.conn.CONNECTIVITY_CHANGE broadcast?

落爺英雄遲暮 提交于 2019-12-29 04:41:07
问题 I have defined a receiver in a sandbox Android N application: <receiver android:exported="true" android:name="com.sandboxapplication.NetworkReceiver"> <intent-filter> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> </intent-filter> </receiver> It's rather simple: public class NetworkReceiver extends BroadcastReceiver { private static final String TAG = NetworkReceiver.class.getName(); @Override public void onReceive(Context context, Intent intent) { Log.i(TAG, "Received Network

Android N change language programmatically

丶灬走出姿态 提交于 2019-12-27 10:43:52
问题 I found really weird bug that is reproduced only on Android N devices. In tour of my app there is a possibility to change language. Here is the code that changes it. public void update(Locale locale) { Locale.setDefault(locale); Configuration configuration = res.getConfiguration(); if (BuildUtils.isAtLeast24Api()) { LocaleList localeList = new LocaleList(locale); LocaleList.setDefault(localeList); configuration.setLocales(localeList); configuration.setLocale(locale); } else if (BuildUtils

Android N: checking for DND state changed before updating checkbox preference

瘦欲@ 提交于 2019-12-25 09:03:04
问题 My app sets the ringer mode to silent but with Android N I get a java.lang.SecurityException: Not allowed to change Do Not Disturb state . I followed the steps from this post and the following code will open an activity which contains a toggle button for enabling the permission to change the ringer mode. This activity can be "backed" from without the enabling of the permission. Intent intent = new Intent( android.provider.Settings .ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS); startActivity

Adobe creative SDK not working for Android Nougat

陌路散爱 提交于 2019-12-25 08:49:47
问题 I have been using the Adobe creative sdk image editor for Android in one of my applications. The library was working fine till Android Marshmallow. After I upgraded my device to Android Nougat I am unable to open the editor and my app keeps crashing. This is the message I get in my logcat java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib/libcutils.so" needed or dlopened by "/system/lib/libnativeloader.so" is not accessible for the namespace "classloader-namespace" I am using

Android 7.0/API24: How to check for notification access (Settings.Secure.enabled_notification_listeners)

浪尽此生 提交于 2019-12-25 08:00:10
问题 In Android 6.0/API23 and earlier, the following used to work: String settingEnabled = android.provider.Settings.Secure.getString(this.getContentResolver(), "enabled_notification_listeners"); In Android 7.0 Nougat/API24 this seems to be no longer supported, because the code above returns null . It actually was never mentioned here: https://developer.android.com/reference/android/provider/Settings.Secure.html How do we check if our app has notification access in Android 7.0 Nougat API24? Edit:

Android 7.0 Kills App Even When Foreground Service is Running

痴心易碎 提交于 2019-12-24 21:29:51
问题 I have tried every suggestion I could find on the Internet to use Foreground Service to keep my app running beyond sleep and deep sleep modes but nothing has been successful so far. I am working on a taxi booking application. I designed it to start emitting driver's location to server whenever the driver turns himself Online and stop emitting when Offline. The following is the Foreground Service code that is started whenever driver turns himself Online and stopped when he presses online

Bluetooth Connection drops automatically with Anrdoid Application

旧时模样 提交于 2019-12-24 19:38:46
问题 I am creating an application which Connects with the BLE Device with android application programmatically. Here's my code for the Connect / Disconnect When use clicks on the Connect button new Thread(new Runnable() { @Override public void run() { mConnecting = true; mConnectException = null; mConnectWait.close(); // Reset the condition. if (mConnectedGatt != null) { // Reconnect to the BLE DEX adapter. Logger.d(LOG_TAG, "going to connect"); mConnectedGatt.connect(); BluetoothDevice device =

Z-order changed in activity transition animations on android 7.0 (nougat)?

泪湿孤枕 提交于 2019-12-24 00:59:08
问题 I use custom animations for onBackPressed using @Override public void onBackPressed() { super.onBackPressed(); overridePendingTransition(R.anim.zoom_in, R.anim.slide_outto_right); } On Android 6.x the exit transition has the highest z-order, which means I can slide the leaving activity out while the "new" activity zooms in below it. Everythings fine on Marshmallow, but on Android 7.0 the z-order has reversed. Is anybody else experiencing this? Any fix suggestions? 回答1: The solution to the

Unable to sign apk “with only the traditional scheme” even after setting 'v2SigningEnabled' as false

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 19:15:04
问题 I updated my android-studio to latest stable version i.e. 'Android Studio 2.3 ' and also the gradle to 2.3.0 . Now, when I am trying to generate a signed apk of my app's release build, this "extra" thing (Signature versions:) is getting shown in the last step: I clicked on 'Signature Help' and this page got opened. I followed the doc and made changes to my build.gradle file like this: apply plugin: 'com.android.application' //Put Fabric plugin after Android plugin apply plugin: 'io.fabric'