背景

当我在Android 7.0及以下手机运行启动页,进行Activity跳转的时候,完美跳转到对应的目标Activity。

但当在Android 8.0及以上手机进行Activity跳转时,会爆如下错误:

 java.lang.SecurityException: Permission Denial: null asks to run as user 450 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS
at android.os.Parcel.readException(Parcel.java:1942)
at android.os.Parcel.readException(Parcel.java:1888)
at android.view.autofill.IAutoFillManager$Stub$Proxy.addClient(IAutoFillManager.java:326)
at android.view.autofill.AutofillManager.ensureServiceClientAddedIfNeededLocked(AutofillManager.java:896)
at android.view.autofill.AutofillManager.notifyViewExited(AutofillManager.java:487)
at android.view.View.notifyEnterOrExitForAutoFillIfNeeded(View.java:6945)
at android.view.View.dispatchAttachedToWindow(View.java:17413)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1658)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:658)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)

常规解决方法

StackOverFlow上面的方法增加权限

<permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" android:protectionLevel="signature"/>

发现并没有什么作用!!!!

我的解决方法

解决历程

经过几个小时的排查发现,当我的目标Activity继承AppCompatActivity时 程序没有问题。当目标Activity继承我自己的BaseActivity(我这个BaseActivity最终也会继承AppCompatActivity)时就会出现问题。

完美解决方法

我自己的BaseActivity里面有一个用于获取用户ID的public void getUserId()方法,就是这货。

当你把这个方法改过名字(例如:getLocalUserId())或者修改该**getUserId()private时,程序完美运行。

因此,可以知道这个
getUserId()*是在原基类里面有实现的。

最后,希望我的方法能帮助到各位小伙伴。Thx~

关于Android 8.0java.lang.SecurityException: Permission Denial错误的解决方法的更多相关文章

  1. java.lang.SecurityException: Permission Denial: writing android.support.v4.content.FileProvider uri

    在使用红米手机拍摄照片时,出现闪退的情况. 调用系统相机拍摄照片,使用FileProvider.getUriForFile传入Uri时,报异常 java.lang.SecurityException: ...

  2. java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/20 from pid=711, uid=10074 requires android.permission.READ_

    java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider ur ...

  3. Android java.lang.SecurityException: Permission Denial

    报错: java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE ...

  4. 启动android程序和虚拟机时候出现如下错误的解决方法

    启动android程序和虚拟机时候出现如下错误的解决方法. 错误重现: [2011-07-13 16:22:48 - Emulator] invalid command-line parameter: ...

  5. myeclipse tomcat java.lang.OutOfMemoryError: PermGen space错误的解决方法

    错误代码: java.lang.OutOfMemoryError: PermGen space 原因分析: myeclipse或tomcat的内容分配的不够用,启动失败 解决方法: 1.找到tomca ...

  6. Linux下scp报Permission denied错误的解决方法

    sudo vim /etc/ssh/sshd_config 把PermitRootLogin no改成PermitRootLogin yes如果原来没有这行或被注释掉,就直接加上PermitRootL ...

  7. java.lang.SecurityException: Permission denied (missing INTERNET permission?) 解决

    Android app里试图用HttpUrlConnection获取网络连接,忘记在AndroidManifest清单文件里声明需要用到Internet的权限,运行时报此错误. 解决方法 在Andro ...

  8. java.lang.SecurityException: Permission denied (missing INTERNET permission?)

    ndroid app里试图用HttpUrlConnection获取网络连接,忘记在AndroidManifest清单文件里声明需要用到Internet的权限,运行时报此错误. 解决方法 在Androi ...

  9. Tomcat 优化 java.lang.OutOfMemoryError: Java heap space 的解决方法

    Tomcat 优化 java.lang.OutOfMemoryError: Java heap space 的解决方法 java.lang.OutOfMemoryError: Java heap sp ...

随机推荐

  1. Heroku登录问题

    second_app 这一步还没有完成,登录接口维护.

  2. pwnable.kr-leg-witeup

    做过后其实知道,是很简单的一段代码,也很容易看懂,看懂后计算key1.key2.key3之和即可. main 汇编: 嗯,看来keyx的返回值是r0了,详细分析r0值. key1: 在arm状态下,r ...

  3. layabox 1 基础

    屏幕适配: class GameMain{ public static gameStart:GameStart; public static gameView:GameView; public sta ...

  4. 关于fftshift----将零频率的分量移到频谱的中心

    fftshift 作用:将零频点移到频谱的中间 用法: Y=fftshift(X) Y=fftshift(X,dim) 描述:fftshift移动零频点到频谱中间,重新排列fft,fft2和fftn的 ...

  5. 面向对象的 __slots__

    优点: 1. __slots__ 能够减小内存的占用,限制对象只能有这几个属性,再加属性会报错 . 副作用: 1. 设置了__slots__之后,实例对象就没有__dict__了 2. __slots ...

  6. 计算机网络ip地址

    ip地址组成 IP地址 = 网络地址 + 主机地址(又称:主机号和网络号组成) 我们通常将网络也可以分为很多的子网络,每个子网络有自己的网络地址,每个子网络由很多的计算机组成(当然也可以包含另外一个子 ...

  7. Lonsdor K518ISE SCION 2011-2018 Models Enabled!

    Lonsdor released the Lonsdor K518ISE Key Programmer update announcement on 14-03-2019, saying it can ...

  8. How to Reset VW Steering Assist 1S1909144P with OBDSTAR X300 DP

    Vehicle model:VW Polo 2015 (or other Audi, Seat, Skoda, VW with unit 1S1 909 144 P) Module:Control u ...

  9. java idea导入ecli项目

    转:https://blog.csdn.net/deng11408205/article/details/79723213 1.关闭所有项目:开启idea进入导入项目选项 2.选择.classpath ...

  10. Netsharp系列文章目录结构

    作者:秋时  转载须说明出处  Netsharp交流群:338963050(请有详细的请求说明) ->. 总体介绍 Netsharp总体介绍 一. Netsharp快速入门系列 Netsharp ...