Questions tagged [parcelable]

parcelable refers to the capability of an object to be converted to a parcel, a container for reading and writing data of various type, using type specific rather than generic serialization

parcelable is defined in the Android API as as interface for classes whose instances can be written to and restored from a parcel

References

1664 questions
0
votes
1 answer

AIDL implementation on Custom Object in separate module

I have a custom Employee object in one module which doesn't implement Parcelable(module doesn't allow android components) How can i implement AIDL in separate android module which returns Employee object in one of the methods? One way i can achieve…
0x52616A657368
  • 388
  • 3
  • 24
0
votes
1 answer

Android: How do I work with IntArrays in Parcelable?

In my app I have a class CurrentGame, which I set up according to the example in this question: Android Class Parcelable with ArrayList However, I don't know how to add the intArray scoresRnd to the Parcel Constructor. When I add this line, for…
Kubi
  • 73
  • 6
0
votes
1 answer

Send data not to next activity, but the one after (using parcelable)

Let's say in Activity A (Score) I create instances of my custom class Player. How can I send these objects to Activity C, without needing to deal with them in Activity B (SelectGamemode)? This is how I send the objects via Parcelable from Activity A…
0
votes
1 answer

Problems when using Parcelable in connection with buttons

I am writing a simple app in which at one point you initialize instances of my custom class "Player" and then pass these objects on to the next activity via parcelable. This was working fine so far, however I completely redid the code for the button…
Kubi
  • 73
  • 6
0
votes
1 answer

Passing data among components and apps

The are different ways how to pass data among components and apps in Android. For instance, here are some of them: Intent intent = new Intent(this, DestinationActivity.class); intent.putExtra("key", "value"); or Bundle args = new…
0
votes
1 answer

How to monitor the process of placing any Parcel data in to persistent storage

Since the Parcel doc says that changes in the underlying implementation of any of the data in the Parcel can render older data unreadable. So I wonder is there a way to monitor the process, so that we can prevent placing Parcel data to persistent…
twlkyao
  • 14,302
  • 7
  • 27
  • 44
0
votes
1 answer

Write to parcelable from code

I want to create and write data to a parcel. The reason i want to do the following is debugging. I want to write some concise code in one location which enable a certain flow in the application. I want to modify this method to return an object which…
Adam
  • 2,845
  • 2
  • 32
  • 46
0
votes
2 answers

How to access data inside my ArrayList

This is my scenario. I get data from a web service and display those data in recycler view. After that I'm planing to add those data in to local sqlite database and display those data when user open application without internet connection. I decided…
0
votes
0 answers

sending a list of unsupported type using parceler

I'm trying to send a List between two Activites using Parceler. This is what i've been trying to do: Intent intent = new Intent(SearchServices.this,…
Abdul2511
  • 153
  • 1
  • 4
  • 14
0
votes
1 answer

Is it better to use Parcelable than setting object directly in android?

I want to know that is it a good practice to set the objects directly when creating a new Fragment like in the example below or should we always make our object Parcelable and pass through intent? public class sample extends Fragment { private…
OkDroid
  • 185
  • 3
  • 11
0
votes
2 answers

can write OnClickListener into parceable?

Hello I have a trouble with OnClickListener View.OnClickListener listener= new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(Conversations.this, "click on MSG", …
Parad0X
  • 3,634
  • 2
  • 12
  • 23
0
votes
1 answer

Android getParcelableExtra returns null

I am currently trying to pass some data from my fragment to an activity. I am passing some parameter, and also an arraylist of a model class. I already make sure that the arraylist before I passed it is not null, since I am able to print out the…
user3576118
  • 375
  • 1
  • 5
  • 24
0
votes
2 answers

How to pass List of custom object using intent as I am getting error using Serializable

I have a list of object and I want to pass it through intent. I have implemented Serializable as well but app is crashing. public class YoutubePlaylist implements Serializable{ @SerializedName("message") @Expose private String…
bhaskar
  • 991
  • 1
  • 15
  • 37
0
votes
0 answers

Android - Parcel a Span object

My goal is to serialize spanned objects only, without text. I was very happy to found that all(most of them) Span objects implement Parcelable interface But it turned out that Android doesn't follow the Parcelable protocol and there is no CREATOR…
Mickey Tin
  • 3,408
  • 10
  • 42
  • 71
0
votes
1 answer

Exception on onSaveInstanceState when Fragment starts another Fragment

Experts, I'm struggling with the following issue: I have an Activity that starts Fragment A. Fragment A starts Fragment B when a button is clicked. Fragment B has a ListView and a custom BaseAdapter to popuplate it. When I place the app in the…
checkmate711
  • 3,301
  • 2
  • 35
  • 45