Câu hỏi phỏng vấn Android
Câu hỏi

What is Intent vs Sticky I...

Câu trả lời

Here is a concise answer to your Android interview question comparing Intent, Sticky Intent, and Pending Intent:

Intent

  • An Intent is a messaging object used to request an action from another app component[1].
  • Intents can be used to start activities, services, and broadcast receivers[1].
  • There are two types of Intents: explicit (specifies the component) and implicit (specifies an action to perform)[3].

Sticky Intent

  • A Sticky Intent is a broadcast Intent that sticks around after it's been broadcast[1].
  • When a sticky broadcast is sent, the system holds onto the final data content of the Intent and keeps it around for any new receivers[1].
  • Sticky Intents are deprecated as of Android 5.0 (API level 21) and should not be used in new apps[1].

Pending Intent

  • A PendingIntent is a token that you give to a foreign application (e.g. NotificationManager, AlarmManager, Home Screen AppWidgetManager) which allows the foreign app to use your app's permissions to exec...
expert

expert

Gợi ý câu hỏi phỏng vấn

senior

Can you manually call the Garbage collector?

junior

How can I get the context in a Fragment?

junior

What types of Context do you know?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào