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

What is Parcelable in Android?

Câu trả lời

Parcelable is an Android-specific interface that allows objects to be serialized and deserialized efficiently for passing between Android components, such as activities, services, and fragments, via Intents or Bundles[1][2][3].

The key differences between Parcelable and Java's built-in Serializable interface are:

  • Parcelable uses a custom binary serialization format optimized for Android's IPC mechanism, making it faster and more efficient than Serializable[2][3].
  • Parcelable avoids using reflection, which can cause performance issues on Android[3].
  • Parcelable requires you to manually write the serialization and deserialization code by implementing the writeToParcel() and CREATOR methods[1][2].

To exclude a field from being parcelized, you can either:

  1. Exclude the field manually by not writing it to the Parcel in the `writeToPa...
middle

middle

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

middle

What is the difference between a Bundle and an Intent ?

expert

What is the relationship between Looper , Handler and MessageQueue in Android?

expert

What happens if the user navigates away or closes the app while I still have a reference to the Activity
the user just closed in my AsyncTask ?

Bình luận

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

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