0

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");

1 Answers1

1

You can convert your int to bytes by using a ByteBuffer.

byte[] bytes = ByteBuffer.allocate(4).putInt(year).array();
Daud Arfin
  • 2,499
  • 1
  • 18
  • 37