0

I have a preferences screen with an option to start one of my activities by definition like this

<Preference android:title="@string/account_details">
        <intent android:targetPackage="com.company.appname"
            android:targetClass="com.company.appname.activities.AccountDetailsActivity"/>
    </Preference>

The problem is since I added a product flavor in my grade file and gave it a applicationId the Activity start results in a java.lang.SecurityException: Permission Denial: starting Intent ...

Is it possible to solve it without android:exported="true"?

georgij
  • 2,054
  • 4
  • 27
  • 43

1 Answers1

0

Just remove absolute packages, change:

com.company.appname.activities.AccountDetailsActivity

to

.activities.AccountDetailsActivity

Some info: What's the "dot" for when registering an Activity

Community
  • 1
  • 1
Rafal Zawadzki
  • 963
  • 6
  • 15