Intent filters for #android beginners

Read Time < 1 minute
Much have been written and discussed about Intent filters and their types (explicit and implicit). I am just going to discuss their usage in basic/simple android applications.
You don’t need to define any intent-filter (other that the launcher activity) if your application doesn’t call external intents e.g reading contacts, and you are not intended to receive any broadcast from other applications e.g receiving incoming call notification.

You should call your all activities and services with explicit intents i.e calling them with their names. For example if you have two activites and a service named: [launcher activity]

your AndroidManifest.xml should look like this:

?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
    android:versionName="1.0" >


        android:label="@string/app_name" >

            android:label="@string/app_name" >

            android:label="@string/app_name" >

To start service/activity you should use explicit intent like this

Intent i=new Intent(this,SecondActivity.class)

Intent ii=new Intent(this,Myservice.class);

Do you have anything to tell? tell me.

Leave a Comment

Your email address will not be published. Required fields are marked *