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

What is an Android PendingIntent ?

Câu trả lời

A PendingIntent is a token that you give to a foreign application (e.g. NotificationManager, AlarmManager, Home Screen AppWidgetManager, etc.), which allows the foreign application to use your application's permissions to execute a predefined piece of code[1][2].

If you give the foreign application a regular Intent, it will execute your Intent with its own permissions. But if you give the foreign application a PendingIntent, that application will execute your Intent using your application's permissions[2].

Some key points about PendingIntents:

  • They are created using static factory methods like PendingIntent.getActivity(), PendingIntent.getService(), etc.[1][3]
  • They allow you to pass an Intent to another app to be executed at a later time, even if your app is no longer running[1][3]
  • The target Intent can be an Activity, Service, BroadcastReceiver, etc.[1][3]
  • The target Intent should usually specify an explicit component name to ensure it is sent to ...
middle

middle

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

senior

How to avoid reverse engineering of an APK file?

middle

What is the difference between ListView and RecyclerView ?

senior

Provide some tips to reduce battery usage in an android application

Bình luận

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

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