Reputation: 25
I had a calendar widget and passed the values to another activity through bundle. How can I, after getting values from bundle, convert "year","month","day" into bytes?
int year = extras.getInt("year");
int day = extras.getInt("day");
int month = extras.getInt("month");
Upvotes: 0
Views: 1740
Reputation: 2499
You can convert your int to bytes by using a ByteBuffer.
byte[] bytes = ByteBuffer.allocate(4).putInt(year).array();
Upvotes: 1