user1257220
user1257220

Reputation: 187

Redirect from an App

How would I go about catching a user trying to use the Message application and either redirect them to my App or throw up a message?

Upvotes: 0

Views: 187

Answers (1)

zapl
zapl

Reputation: 63945

you register your app for the same Intent in the Manifest. Then user can chose if he would like to use your application to write messages or another one. E.g. http://developer.android.com/reference/android/content/Intent.html#CATEGORY_APP_MESSAGING

E.g. in your AndroidManifest.xml add to your Activity:

<activity .... >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.APP_MESSAGING" />
    </intent-filter>
</activity>

But: you can't force users to use your app. If user decides that his messaging app should be default for that Intent then you have no way to intercept that.

Upvotes: 1

Related Questions