I am writing an application to open HTML files so i am mentioning the intent filter for activity as
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/html" /> </intent-filter>
,for this app, no launcher icon will be there.but i want my application to be as launcher app and when i open the app i want to display some info about application,and then he open the app by html file then i want to do different functionality (parsing the html).any ideas?
If it fails to match even one of them, the Android system won't deliver the intent to the component. However, because a component may have multiple intent filters, an intent that does not pass through one of a component's filters might make it through on another filter.
Each <data> element can specify a URI and a data type (MIME media type). There are separate attributes like scheme, host, port, and path for each part of the URI. An Intent object that contains both a URI and a data type passes the data type part of the test only if its type matches a type listed in the filter.
There are two intents available in android as Implicit Intents and Explicit Intents.
You can specify more than one <intent-filter>
between the <activity>
tags:
<activity android:name=".MyActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/html" /> </intent-filter> </activity>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With