What is the purpose of a custom category or action?

I am reading “Getting Started Developing Android Applications” by Wei-Mung Lee. I am confused about user actions and categories.

Here is the code from one example. Action is the name of the package. The only time it has ever been mentioned is

Intent i = new Intent( "net.learn2develop.MyBrowser" );

to start the action. How can this mean that this action, which is basically the name of the package, can start its activity? Just because it's inside an activity tag?

Same thing with a category tag (another example):

<intent-filter>
   <action android:name="android.intent.action.VIEW" />
   <action android:name="net.learn2develop.MyBrowser" />
   <category android:name="android.intent.category.DEFAULT" />
   <category android:name="net.learn2develop.Apps" />
   <data android:scheme="http" />
</intent-filter>

net.learn2develop.Apps is the name compiled by the author. That really doesn't make sense, does it? What purpose does he fulfill?

+5
source share
2 answers

, , , ?

<intent-filter> , . BTW, , , , (, android.intent.action.VIEW ). .

, ?

, , , - , , .

?

Android . , - , Android.

. , , DEFAULT - BROWSABLE. , VIEW BROWSABLE, -. , VIEW/BROWSABLE MIME- application/pdf, PDF , PDF . , BROWSABLE , . BROWSABLE, URL- HTTP.

, .

+8

?

. , BroadcastReceiver (.. ), , , , , .

, :

intent.addCategory('com.super.dooper.thing.my_sectrect_category')

, , .

+1

All Articles