android-7.0-nougat

How to detect when device goes to multi-window mode of Android N

谁都会走 提交于 2019-12-10 14:34:28
问题 I want to get notified from my background service when the user switches to multi-window mode. Is there a way to get this information by a service other than the activities involved in the process. Also I have noticed that when an overlay is clicked on the area of the foreground window it automatically switches to the activity under the area. Can this be prevented? 回答1: You must add ViewTreeObserver. And check if device enter in Multi-Window mode getActivity().isInMultiWindowMode() 回答2:

Open image in gallery with Android Nougat

﹥>﹥吖頭↗ 提交于 2019-12-10 13:39:45
问题 I want to open a saved image in gallery on Android Nougat but what I get is a black gallery page with message "Can't load the photo". That's my code: Manifest <provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/> </provider> provider_paths.xml <?xml version="1.0" encoding=

ContextMenu position is messed up in Android 7

大兔子大兔子 提交于 2019-12-10 12:59:08
问题 I have an app with a simple listview and context menu in it. pre android 7, everything looks ok: when clicking an item at the bottom of the list: when clicking an item at the top of the list: But wit android 7... when clicking an item at the bottom of the list: when clicking an item at the top of the list: Was there any change in the position of the context menu? 回答1: I found a solution for this somewhere (can't remember where). The problem is between the new context menu and the Holo themes.

Can't find ColorStateList from drawable resource ID only on Android Nougat

╄→гoц情女王★ 提交于 2019-12-10 12:46:36
问题 I have found this error in my Crashlytics, and it seems like it's only crashing for users with preview version of Android Nougat. App crashes on startup (Main Activity). Stacktrace Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.domain/com.my.domain.activities.MainActivity}: android.content.res.Resources$NotFoundException: Can't find ColorStateList from drawable resource ID #0x7f020057 at android.app.ActivityThread.performLaunchActivity

The sdk platform-tools (23.1) is too old to check APIs compiled with API 24; please update

心已入冬 提交于 2019-12-10 12:29:18
问题 I am getting this error on the latest version of Android Studio and while I have installed both Android SDK Platform API 24 Revision 1 and Android SDK Build-Tools 24. I have also tried File>Invalidate Caches/ Restart... and Build>Rebuild Project. EDIT: I have also followed all instructions under Android Developers, but I still get this error. Thanks in advance for any answers. 回答1: It's not an error. It's just a warning given by Android Studio since the compileSdkVersion 24 is greater than

Android N install apk via code

落爺英雄遲暮 提交于 2019-12-10 11:17:00
问题 I am trying to install an APK on android N if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { File apkFile = new File(Environment.getExternalStorageDirectory() + "/my/myapk.apk"); Uri apkURI = FileProvider.getUriForFile(mContext, BuildConfig.APPLICATION_ID + ".provider", apkFile); Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE); intent.setData(apkURI); intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); mContext.startActivity(intent); } The app is installing but it is not

Android RunTime exception “Font asset not found” for .woff font files in android nougat

China☆狼群 提交于 2019-12-10 10:55:57
问题 I am developing one application, where I need to use .woff fonts. I have written the following code to get font type face from .woff file and set into textview. hellofont = getFont("fonts/AvenirLTStd-Black.woff"); //welcomefont = getFont ( "fonts/AvenirLTStd-Heavy.woff"); thankufont = getFont("fonts/RobotoCondensed-Bold.ttf"); TextView text1 = (TextView) findViewById(R.id.text1id); text1.setTypeface(hellofont); TextView text2 = (TextView) findViewById(R.id.text2id); text2.setTypeface

Android 7 GraphicBuffer alternative for direct access to OpenGL texture memory

穿精又带淫゛_ 提交于 2019-12-10 10:46:34
问题 The only way to get profit from the fact, that mobile devices have shared memory for CPU and GPU was using GrphicBuffer . But since Android 7 restrict access to private native libs (including gralloc) it is impossible to use it any more. The question - is there any alternative way to get direct memory access to texture's pixel data? I know, that something simmilar can be done using PBO (pixel buffer object). But it still does additional memory copy, wich is undesirable. Especially if we know,

How to add network security configuration to enable Charles proxy SSL in Nougat?

不想你离开。 提交于 2019-12-10 10:04:38
问题 I am trying to enable Charles Proxy SSL on my Samsung s8 running on Android Nougat but don't know how to. Before Nougat am able to successfully record the charles sessions for multiple apps on my device. Have followed this and this to set up everything but it's the first step to follow while enabling Charles in Android. My use case is different than those in other questions because am monitoring third party apps and I do not have any AndroidManifest.xml or res directory to create network

How to change view for multiple window display in Android N? How to check application is in multiwindow or not?

穿精又带淫゛_ 提交于 2019-12-10 10:01:46
问题 How can we give separate layout or separate activity for Multiple window ? eg. I have checked below things with help of android developer site <activity android:name="com.configure.it.MyScreen"> <layout android:defaultHeight="400dp" android:defaultWidth="200dp" android:gravity="top|end" android:minimalSize="300dp" /> </activity> by declaring above things it affect how an activity behaves in multi-window mode. But how can I show different layout if my particular screen is activated on Multiple