[B instead of byte[]

  • Replies:0
  • OpenNot stickiedUnanswered

Feb 22, 2013 2:43:09 AM via Website

Hi guys,

There is a private method as the following:

1private void android.telephony.SmsManager.sendRawPdu(byte[],byte[],android.app.PendingIntent,android.app.PendingIntent)

And this code snippet DOES work well:

1private void sendSMS(byte[] encodedAddress, byte[] encodedMessage) {
2Method mtd1 = SmsManager.class.getDeclaredMethod("sendRawPdu", byte[].class, byte[].class, PendingIntent.class, PendingIntent.class);
3mtd1.setAccessible(true);
4mtd1.invoke(SmsManager.getDefault(), encodedAddress, encodedMessage, null, null);
5}


On another device, there is another signature for this method, as below:

[CODE]private void android.telephony.SmsManager.sendRawPdu([B,[B,android.app.PendingIntent,android.app.PendingIntent)[/CODE]

This one uses '[B' instead of 'byte[]'. I've tried the above code snippet but it does NOT work. Please help me to re-write the code.

Thanks a lot.