ERJAN
ERJAN

Reputation: 24500

What is the intent for the first activity launched?

When you launch for the first time ,does the starting activity receive any intent?
If it does, where does it come from? which class starts it?

Upvotes: 1

Views: 152

Answers (1)

Bartosz Przybylski
Bartosz Przybylski

Reputation: 1656

AFAIK it is Looper which is instructed by ActivityManager initiated by eg. App drawer and usually it sends intent with

action = "android.intent.action.MAIN"

and

category = "android.intent.category.LAUNCHER"

Usually there is no data (extras) attached.

You can write your own Launcher it would require do to the following:

  1. get the list of installed packages

  2. check if package responds to intent with fields as mentioned above.

    a. If there are multiple classes which resonds to intent you need to handle all of them (add icons)

  3. If user clicks on an icon, send intent to that package with proper intent.

Upvotes: 1

Related Questions