android - Implicit intent within same application -



android - Implicit intent within same application -

how build intent , manifest can invoke activity application implicit intent.

the thought writing general code wish utilize in number of applications. code held in android library , linked using application. general code opens activity , work. 1 time done (user clicks button) needs transfer activity specific application.

as per understanding on questions,

you can declare activity specified implicit intent in application's manifest file..

for example: if want create application view image application , have utilize application on device can allow other activity view image using implicit intent action.view ,just

<activity android:label="@string/app_name" android:name=".myimagevieweractivity"> <intent-filter> <action android:name="android.intent.action.main"> <category android:name="android.intent.category.launcher"> </category></action></intent-filter> <intent-filter> <action android:name="android.intent.action.view"> <category android:name="android.intent.category.default"> <data android:mimetype="image/*"> </data></category></action></intent-filter> </activity>

in above code can see intent-filter has next properties.

a. action: type activity respond for.like activity respond view action.

b. category: implicit intents divided in categories.like activity in default category.

c. data: specify more info intent-filter. activity handle file of mimetype “image/*”.

and when install application in device , click on image file, see selection dialog offer select between default application , application. select application see image.

for more info illustration @ what intent filter in android?

tutorial: registering via intentfilter

android android-intent android-manifest android-activity

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -