android-7.0-nougat

“Canvas: trying to draw too large bitmap” when Android N Display Size set larger than Small

馋奶兔 提交于 2019-11-27 06:52:18
I have a published app that is crashing at startup on Android N when the newly introduced Display size OS setting is set to too large a value. When I look in logcat, I see the following message: java.lang.RuntimeException: Canvas: trying to draw too large(106,975,232 bytes) bitmap. I've traced the issue to an ImageView in my first Activity that shows a nice big background image. The image in question is 2048x1066 and is in my generic drawables directory, so no matter the density, this image will be used. Everything works okay when the Display size setting is Small . But when I go up to Default

How to get charles proxy work with Android 7 nougat?

我怕爱的太早我们不能终老 提交于 2019-11-27 05:53:41
Android 7 introduced some changes to the way certificates are handled ( http://android-developers.blogspot.com/2016/07/changes-to-trusted-certificate.html ) and somehow I cannot make my Charles proxy work any more. My network_security_config.xml: <?xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config> <debug-overrides> <trust-anchors> <certificates src="user" /> </trust-anchors> </debug-overrides> </network-security-config> I'm running in debug mode. But no matter what, I get javax.net.ssl

Detect Network State change using JobSchedulers in Android

試著忘記壹切 提交于 2019-11-27 04:36:55
问题 With Android N, You cannot statically register a Broadcast receivers for CONNECTIVITY_CHANGE intent. From http://developer.android.com/preview/features/background-optimization.html#connectivity-action Google documentation suggest using Job Schedulers to perform this task. Is it possible to detect network state change (LTE to wifi) and vice versa using Job Schedulers in Android? 回答1: Yes and no. The JobInfo.Builder.setRequiredNetworkType() method allows you to schedule jobs to run when

Replacing default Phone app on Android 6 and 7 with InCallService

萝らか妹 提交于 2019-11-27 02:02:34
Android API level 23 added InCallService to provide the user-interface for managing phone calls . The documentation provides an example manifest registration but I couldn't get it to work. The app compiles fine but Default Apps in settings doesn't show my app. The only place I found any information about the subject was a StackOverflow question that was closed a year ago. Comment on that question proposed to add android.intent.action.DIAL activity but that didn't help me either. I have tried various combinations of other intent's too ( android.intent.action.CALL_DIAL and android.intent.action

java.lang.NullPointerException with Nougat

风格不统一 提交于 2019-11-27 01:51:48
问题 My app has been humming along nicely through various Android versions. I have users running it on Android 4.3, 5.0, 5.1 and 6.0 with no problems. However a user with a S7 Edge has just updated with Android 7.0 and the app is crashing when text is pasted into an EditText field (This is the first and only thing you do with this app - it starts you paste in text into a box and then the app parses the text). I have looked at many threads on Null Pointer Exceptions and I have looked at the source

Missing buttons on AlertDialog | Android 7.0 (Nexus 5x)

走远了吗. 提交于 2019-11-26 23:00:12
问题 I am trying to create an AlertDialog but the buttons are not showing. Only seeing this issue in Android 7.0: final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("This app needs location access"); builder.setMessage("Please grant location access so this app can detect beacons."); builder.setPositiveButton(android.R.string.ok, null); builder.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override @TargetApi(Build.VERSION_CODES.M) public void

Eclipse - Empty Logcat with Android 7

纵然是瞬间 提交于 2019-11-26 22:56:18
问题 I recently updated my Nexus 9 Tablet to Android 7 Nougat. Since then the Logcat view in Eclipse stoped displaying Logcat messages, the view just stays empty. Also the devices target is shown as "Unknown". If I instead start Logcat outside Eclipse (AndroidSDK->tools->ddms) it displays all messages. However, then the "Application" Column stays empty. There are allready some (older) questions on this topic here on SO, but none of the solutions here worked for me. What i tryed: Use another USB

Android N requires the IDE to be running with Java 1.8 or later?

♀尐吖头ヾ 提交于 2019-11-26 19:33:07
My XML layout is not rendering with this error message. I am already using Java 8. Also using latest build tools in Gradle. android { compileSdkVersion 'android-N' buildToolsVersion 24.0.0 rc1 ... } XML Error - I got the same error you describe but on OS X. I know this may not solve your problem (because I don't know the equivalent for Windows), but since this is not OS specific I am leaving the solution for any OS X fellow out there. Edit the file /Applications/Android\ Studio.app/Contents/Info.plist , and remove the 1.6 version (in my case), you may place 1.6+, 1.7+ or 1.8, whichever you

Expand/Collapse Lollipop toolbar animation (Telegram app)

蹲街弑〆低调 提交于 2019-11-26 19:16:21
I'm trying to figure out how the expand/collapse animation of the toolbar is done. If you have a look at the Telegram app settings, you will see that there is a listview and the toolbar. When you scroll down, the toolbar collapse, and when you scroll up it expands. There is also the animation of the profile pic and the FAB. Does anyone have any clue on that? Do you think they built all the animations on top of it? Maybe I'm missing something from the new APIs or the support library. I noticed the same behaviour on the Google calendar app, when you open the Spinner (I don't think it's a spinner

In Android 7 (API level 24) my app is not allowed to mute phone (set ringer mode to silent)

自古美人都是妖i 提交于 2019-11-26 18:49:19
I have an app that mutes the phone by using AudioManager and setting ringer mode to silent with this code: AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); try { audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT) } catch (Exception e) { e.printStackTrace(); } This works with Android 6, but now with Android 7, I get the following error: System.err: java.lang.SecurityException: Not allowed to change Do Not Disturb state System.err: at android.os.Parcel.readException(Parcel.java:1683) System.err: at android.os.Parcel.readException(Parcel.java