Thrown when a security manager check fails.
Questions tagged [android-securityexception]
168 questions
1
vote
0 answers
PdfRenderer throws SecurityException everytime if user select first Pdf document which is protected
I have used below code please checked it.
PdfRenderer.Page page = null;
Bitmap mBitmap;
try {
descriptor = getSeekableFileDescriptor(documentPath);
renderer = new PdfRenderer(descriptor);
page =…

Jyubin Patel
- 1,373
- 7
- 17
1
vote
0 answers
Java android change brightness Android 6.0
This is my code to change screen brightness :
protected void changeBrightness(int progress, int lvl) {
android.provider.Settings.System.putInt(getContentResolver(),
…

jpok
- 143
- 2
- 2
- 11
1
vote
2 answers
Android API 26 SecurityException issue
In my app I have a fragment and an imageButton inside of this fragment. When I run the app in my device (Android 8 - API 26) and click imageButton, the app crashes and throws a runtime error which I didn't see before.
E/AndroidRuntime: FATAL…

S.Grain
- 182
- 12
1
vote
1 answer
Android Content Provider Security Exception
I am trying to open a PDF or Text file from my app with other reader application like Google Drive PDF viewer etc. But it is showing the following error.
java.lang.SecurityException: Permission Denial: opening provider…

Zim
- 182
- 1
- 1
- 10
1
vote
1 answer
Open camera and Capture image issue
I am trying to make a simple application which uses the system camera application to take picture. I have tested my app in android version 6 and my app opens device's camera successfully. But in some android v6 devices (like Samsung Galaxy A3) I get…

Thanos Infosec
- 57
- 1
- 10
1
vote
0 answers
Android - java.lang.SecurityException in android.os.Parcel.readException
I have been working on location based Android application.Also I have taken care of run time dangerous location permissions. It works great while testing the various devices from 4.0 to 8.0.
I have no other dangerous permissions.
If the exception is…

Harsh4789
- 677
- 7
- 17
1
vote
1 answer
How to keep KEYS secure in fully offline app?
I have fully offline app which keeps few KEYS required to achieve functionalities. I am using proguard to secure my app from reverse engineering but afaik it’s not 100% possible to keep app away from reverse engineering.
Also, KEYS are defined as…

VVB
- 7,363
- 7
- 49
- 83
1
vote
1 answer
addAccountExplicitly throws SecurityException because com.google.android.gm is not allowed to perform GET_ACCOUNTS
My app uses SyncAdapters to sync data in the background. On a device running OS 8.0 and setup for Android for Work managed profile, calling addAccountExplicitly throws a SecurityException and fails to add the account properly.
Here is the…

Ted Chu
- 11
- 4
1
vote
1 answer
SecurityException when using uses-permissions
I have two apps : App1 and App2
In App1 specified permission like this
In App2 specified peromission like this

Oksana
- 13,442
- 10
- 53
- 89
1
vote
3 answers
SecurityException: opening provider that is not exported from uid
I have an app which is not on Play Store. I was earlier able to start the app installer by the following code:
In Activity:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new…

mrid
- 5,782
- 5
- 28
- 71
1
vote
1 answer
MediaPlayer: how to Play in STREAM_ALARM
I am beginner in android development. I need to play media from raw file as STREAM_ALARM for my alarm clock. I found a similar question here :
Android MediaPlayer - how to play in the STREAM_ALARM?
The accepted answer was like that on that…

Mushfiqur Rahman
- 88
- 5
1
vote
0 answers
Android crash by java.lang.SecurityException
There are a few reports for an app of hundreds of thousands of downloads as following:
java.lang.SecurityException:
at android.os.Parcel.readException (Parcel.java:1683)
at android.os.Parcel.readException (Parcel.java:1636)
at…

Hong
- 17,643
- 21
- 81
- 142
1
vote
2 answers
java.lang.SecurityException: Permission Denial: starting Intent {act=android.settings.USAGE_ACCESS_SETTINGS}
I get java.lang.SecurityException when try to startActivityForResult(intent, requestCode); with final Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS); intent. Interesting that this crash happens only on Huawei with Android 5.1 -…

Ruslan Leshchenko
- 4,043
- 4
- 24
- 36
1
vote
2 answers
Permission denial while accessing content provider of another application
Tutorial I am using for understanding Content Providers
AppA: https://www.tutorialspoint.com/android/android_content_providers.htm
I have created another application which I intend to use, to access the Content Provider of the tutorial…

SamT01
- 125
- 1
- 14
1
vote
1 answer
when using Intent.ACTION_GET_CONTENT how to avoid "SecurityException"
on Android os 5.11 (maybe other os as well), When using Intent.ACTION_GET_CONTENT to list the files with Android system file picker,
Intent openIntent = new…

lannyf
- 9,865
- 12
- 70
- 152