android-7.0-nougat

Open downloaded file on Android N using FileProvider

谁说胖子不能爱 提交于 2019-12-03 16:59:46
问题 I've got to fix our App for Android N due to the FileProvider changes. I've basically read all about this topic for the last ours, but no solution found did work out for me. Here's our prior code which starts downloads from our app, stores them in the Download folder and calls an ACTION_VIEW intent as soons as the DownloadManager tells he's finished downloading: BroadcastReceiver onComplete = new BroadcastReceiver() { public void onReceive(Context ctxt, Intent intent) { Log.d(TAG, "Download

BitmapFactory.decodeStream from Assets returns null on Android 7

為{幸葍}努か 提交于 2019-12-03 16:12:31
How to decode bitmaps from Asset directory in Android 7? My App is running well on Android versions up to Marshmallow. With Android 7 it fails to load images from the Asset directory. My Code: private Bitmap getImage(String imagename) { // Log.dd(logger, "AsyncImageLoader: " + ORDNER_IMAGES + imagename); AssetManager asset = context.getAssets(); InputStream is = null; try { is = asset.open(ORDNER_IMAGES + imagename); } catch (IOException e) { // Log.de(logger, "image konnte nicht gelesen werden: " + ORDNER_IMAGES + imagename); return null; } // First decode with inJustDecodeBounds=true to

Android 7 nougat, how to get the file path from uri of incoming intent?

£可爱£侵袭症+ 提交于 2019-12-03 16:06:51
FileProvider:- Setting up file sharing I know that change the file policy in android nougat. The wanted app that file share to other apps generate the uri by FileProvider. The uri format is content://com.example.myapp.fileprovider/myimages/default_image.jpg . I want know that how can I get filepath from the uri that generate by FileProvider.getUriForFile() . because the my app is need to know the physical filepath in order to save, load, readinfo, etc. is it possible [In short] My app received the intent uri by other apps on andorid 7 nougat. The uri format is content://com.example.myapp

WebView on Android 7.0+ doesn't render page

若如初见. 提交于 2019-12-03 13:48:58
问题 I have WebView screen with license. And everything worked perfectly until users notified me that nothing shows on Android 7+ devices. public class DefaultWebActivity extends AppCompatActivity { WebView mWebView; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.default_web); mWebView = (WebView) findViewById(R.id.web_view); mWebView.setWebChromeClient(new WebChromeClient()); mWebView.getSettings()

DP5 7.0 - Does adding extras to a pending intent fail?

那年仲夏 提交于 2019-12-03 13:01:05
Adding the linked issue on tracker: https://code.google.com/p/android/issues/detail?id=216581&thanks=216581&ts=1468962325 So I installed the DP5 Android 7.0 release onto my Nexus 5X today. I've been working on an app that schedules local notifications at specific times using Android's AlarmManager class. Up until this release, the code has been working great on devices running KitKat, Lollipop, and Marshmallow. Below is how I'm scheduling the alarms: Intent intent = new Intent(context, AlarmManagerUtil.class); intent.setAction(AlarmManagerUtil.SET_NOTIFICATION_INTENT); intent.putExtra

DeadSystemException start service Android 7

喜你入骨 提交于 2019-12-03 13:00:00
问题 For the past few weeks, I have on my crash reporter: Fatal Exception: java.lang.RuntimeException: Unable to start service com.####.MyService@ef705d8 with Intent { act=HIDE cmp=com.####/.MyService (has extras) }: java.lang.RuntimeException: android.os.DeadSystemException at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3344) at android.app.ActivityThread.-wrap21(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1583) at android.os.Handler

Detect Android N version code

岁酱吖の 提交于 2019-12-03 12:38:18
问题 Is it possible to detect if an user is running Android N? I have a Nexus 6 with the Android N Developer Preview. If I try to get the build version with Build.VERSION.SDK_INT , it returns 23 which is equal to Android Marshmallow. 回答1: Quoting myself: Following the approach that Google used for the M Developer Preview, you can check Build.VERSION.CODENAME instead: public static boolean iCanHazN() { return("N".equals(Build.VERSION.CODENAME)); } I haven't looked at Build.VERSION.RELEASE , as

Foreground service not receiving location updates in Android 7.0+ when screen is off

断了今生、忘了曾经 提交于 2019-12-03 11:53:41
问题 I am trying to create an Android application that continuously logs device location data in realtime while the device screen is off. My code works correctly with Android 6.0 and earlier but it seems that Android 7.0+ breaks my app. I have implemented an Android foreground service that uses a wakelock and subscribes to the Google FusedLocation API. Once the screen is turned off the onLocationChanged callback is never triggered. Has anyone seen a solution to this problem? I have tried disabling

Android Nougat PopupWindow showAsDropDown(…) Gravity not working

梦想与她 提交于 2019-12-03 11:47:21
问题 I have this code. PopupWindow popUp = new PopupWindow(); popUp.setFocusable(true); popUp.setOutsideTouchable(true); popUp.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); popUp.setHeight(600); popUp.setContentView(anchorView); popUp.showAsDropDown(anchorView); popUp.update(); And its perfectly works on Android Version < Android Nougat. But in Android Nougat, the popup is being displayed at the top of the screen instead of relative to the anchor view. 回答1: It seems a bug in android 7.0. But you

Bad Notification: Couldn't expand RemoteViews for: StatusBarNotification. on Android Nougat

扶醉桌前 提交于 2019-12-03 10:43:39
I use OneSignal SDK to show notifications. I do it in OneSignalPushService.java . OneSignalPushService.java: public class OneSignalPushService extends NotificationExtenderService { @Override protected boolean onNotificationProcessing(OSNotificationReceivedResult notification) { if (!TinyDbWrap.getInstance().isPushEnabled()) { KLog.d(this.getClass().getSimpleName(), "Notification will not displayed"); return true; } OverrideSettings overrideSettings = new OverrideSettings(); overrideSettings.extender = new NotificationCompat.Extender() { @Override public NotificationCompat.Builder extend