0

I am talking about <action android:name="packagename.ImagePagerActivity" />. It's seems unnessesary to add it, because the application works fine without it. But why do some developers write such reference?

<activity
            android:name=".adapter.imageview.ImagePagerActivity"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Light.NoTitleBar" >
            <intent-filter>
                <action android:name="packagename.ImagePagerActivity" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
freejosh
  • 11,263
  • 4
  • 33
  • 47
Yarh
  • 4,459
  • 5
  • 45
  • 95

2 Answers2

0

Using <action android:name="packagename.ImagePagerActivity" /> Says that you can call this Activity Implicitly

Like

Intent intent = new Intent("packagename.ImagePagerActivity");
startActivity(intent);

Read more about What is the different between Explicit and implicit activity call in android?

Community
  • 1
  • 1
Pankaj Kumar
  • 81,967
  • 29
  • 167
  • 186
0

If you mention

you can invoke your activity from

intent.setAction("packagename.ImagePagerActivity");

and start activity.

Implicit call instead of mentioning current activity and target activity explicitly.

Desu
  • 464
  • 4
  • 6