tags:

views:

39

answers:

1

Suppose that I installed app A and app B, app A has a main activity, and app B wants to show that activity by sending a intent. My question is that how android knows I have installed app A and is able to map the intent to its activity? Is there any windows-registry-like store saving such information?

Thank You

+1  A: 

I'm also new to android. This is how I understand Intents:

Look in your AndroidManifest.xml. There you define activities and intent filters:

<activity android:name=".Settings.SettingsView"
        android:label="@string/settings">
    <intent-filter>
        <action android:name="at.MyApp.Settings.action.EDIT_TITLE" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

When you install your App those activities/services/etc get know to Android. You tell Android, that you are able to provide an activity for "at.MyApp.Settings.action.EDIT_TITLE" If you start an activity, you create an Intend:

startActivity(new Intent("at.MyApp.Settings.action.EDIT_TITLE"));

Anyone can try to start such an activity/service/etc throw an intent.

If two applications are able to provide some functionality for an intent, Android will ask the user which activity it should use.

That's how I understand Intents. If someone knows better I'll be happy to learn.

Arthur