I have the following array
final byte[] texttoprint = new byte[]{0x1b, 0x40, 0x1b,0x74,0x0D,
(byte) 0x91,(byte) 0x92,(byte) 0x93,(byte) 0x94,(byte) 0x95,
(byte) 0x96,(byte) 0x97,(byte) 0x98,(byte) 0x99,
0x0A,0x0A,0x0A,0x0A,0x0A};
and I want to print its values to the logcat in Eclipse, like this:
0x1b , 0x40
and so on.
I tried this:
for (int index = 0; index < texttoprint.length;){
Log.i("myactivity", String.format("%20x", texttoprint[index]));
}
But that does an never ending loop printing 1B.
With this code:
Log.i("myactivity", Arrays.toString(texttoprint));
it prints: [27, 64, 27...]
Where am I wrong?