android-7.0-nougat

Regd : Support of Answer call in Android Nougat

自古美人都是妖i 提交于 2019-12-03 08:47:19
I want to implement Answer call functionality in Android Nougat. The answer call is not supported in Google Nexus 5x. We tried using the code Runtime.getRuntime().exec("input keyevent " + Integer.toString(KeyEvent.KEYCODE_HEADSETHOOK)); The answer call is supported in Google Nexus 6 using the above code. Has anyone worked on the above? Thanks! There is a security patch that is added as an update on many devices above 5.0 from November 2016 onwards, after updating the devices with this November or later updates, will stop this Runtime method to work. 来源: https://stackoverflow.com/questions

Disabling Multi-window feature for Android N not working for an activity

蓝咒 提交于 2019-12-03 07:08:42
I want to disable multi-window support for an activity in my app. I have set resizeableActivity to false in my Manifest but when I long press recent app icon, the app still goes in multi-window mode. Below is my manifest: <activity android:name=".MainActivity" android:resizeableActivity="false" android:excludeFromRecents="true" android:icon="@drawable/ic_launcher_home" android:theme="@style/AppThemeV3.CustomToolbar"> </activity> Per documentation : android:resizeableActivity=["true" | "false"] If the attribute is set to false, the activity does not support multi-window mode. If this value is

Android vector drawable for launcher icon and other images on Android N

心已入冬 提交于 2019-12-03 06:57:46
问题 I'm going to use vector drawable feature for action bar icons and notification icon, on my app. With the announce of Android N , one of his most important feature is Screen Zoom (on Accessibility Improvements section). Another interesting feature is Multi-window support (see link if you want more info). Does this means that we should use vector drawable also for launcher icon and other images used on app? 回答1: Vector drawable is not supported for launcher icons. You are, however, encouraged

Android 7.0 Notification Sound from File Provider Uri not playing

泄露秘密 提交于 2019-12-03 06:06:01
问题 I'm changing my app code for supporting Android 7, but in my NotificationCompat.Builder.setSound(Uri) passing the Uri from FileProvider the Notification don't play any sound, in Android 6 using the Uri.fromFile() worked properly. The mp3 file is in: /Animeflv/cache/.sounds/ This is my Notification Code: knf.animeflv.RequestBackground NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.ic_not_r) .setContentTitle(NotTit) .setContentText(mess);

Android Internet connectivity check better method

家住魔仙堡 提交于 2019-12-03 05:53:25
问题 According to the Android developer site, Determining and Monitoring the Connectivity Status , we can check there is an active Internet connection. But this is not working if even only Wi-Fi is connected and not Internet available (it notifies there is an Internet connection). Now I ping a website and check whether Internet connections are available or not. And this method needs some more processing time. Is there a better method for checking Internet connectivity than this to avoid the time

WebView on Android 7.0+ doesn't render page

不问归期 提交于 2019-12-03 03:45:37
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().setJavaScriptEnabled(true); mWebView.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view

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

南笙酒味 提交于 2019-12-03 03:27:15
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 Battery Optimization through the Android Device Settings for my app as well as for the Google Services

Android Nougat PopupWindow showAsDropDown(…) Gravity not working

巧了我就是萌 提交于 2019-12-03 03:15:35
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. Liang Steve It seems a bug in android 7.0. But you can solve it with a compatible way. PopupWindow popUp = new PopupWindow(); popUp.setFocusable

Detect Android N version code

混江龙づ霸主 提交于 2019-12-03 03:05:53
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. 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 suggested by zgc7009's comment, though that too may be a possibility. Also, if you are reading this from the

Android vector drawable for launcher icon and other images on Android N

与世无争的帅哥 提交于 2019-12-02 20:35:33
I'm going to use vector drawable feature for action bar icons and notification icon, on my app. With the announce of Android N , one of his most important feature is Screen Zoom (on Accessibility Improvements section ). Another interesting feature is Multi-window support (see link if you want more info). Does this means that we should use vector drawable also for launcher icon and other images used on app? Vector drawable is not supported for launcher icons. You are, however, encouraged to use it everywhere else. mixel You can use vector drawables as launcher icon if you follow these steps: