Securing Activities

Activities are started by calling startActivity() (or startActivityForResult() if a result is expected) with either an explicit or an implicit Intent.

To control which apps can start an Activity, add the appropriate permission using the android:permission attribute of the <activity> element in the app’s AndroidManifest.xml file.

<manifest >
  <application >
    <activity android:name="com.example.myamazingapp.SomeActivity"

Only apps that have requested (and been granted) that permission will then be able to start the Activity.

Share this article:

This article is from the free online course:

Secure Android App Development

University of Southampton