A Bundle
can save many types of data: short
, byte
, another Bundle
, ArrayList<Integer>
, yet not a simple long
.
How can this best be achieved? Must it be converted to a ArrayList<Integer>
?
A Bundle
can save many types of data: short
, byte
, another Bundle
, ArrayList<Integer>
, yet not a simple long
.
How can this best be achieved? Must it be converted to a ArrayList<Integer>
?
Are you sure? There are putLong() in docs.
You can store a long inside a bundle^^
Here is how to store your value
//store the long value
long myNumber = 123456789;
Bundle bundle = new Bundle();
bundle.putLong("MY_KEY", myNumber);
//then start your activity
Here is how to retrieve
//retrieve the long value
long value = bundle.getLong("MY_KEY");