title: VFY: unable to resolve static method 10876: Android
body: <p>I used SmsCbMessage.java class in a my program. It was taken from <a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/android/telephony/SmsCbMessage.java#SmsCbMessage">http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/android/telephony/SmsCbMessage.java#SmsCbMessage</a>
  Following is my program.</p>
  
  <pre><code>package com.android.internal.telephony;
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  
  import android.telephony.SmsCbMessage;
  import android.widget.Toast;
  
  public class MainActivity extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
          //---get the CB message passed in---
          Bundle bundle = intent.getExtras();
          SmsCbMessage[] msgs = null;
          String str = "";
          if (bundle != null)  {
              //---retrieve the SMS message received---
              Object[] pdus = (Object[]) bundle.get("pdus");
              msgs = new SmsCbMessage[pdus.length];
              for (int i=0; i&lt;msgs.length; i++) {
                  msgs[i] = SmsCbMessage.createFromPdu((byte[])pdus[i]);
                  str += "CB lang " + msgs[i].getLanguageCode();
                  str += " :";
                  str += msgs[i].getMessageBody().toString();
                  str += "\n";
              }
              //---display the new CB message---
              abortBroadcast();
              Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
          }
      }
  }
  </code></pre>
  
  <p>This compiles without errors. But when running it gives following error </p>
  
  <pre><code>06-21 23:32:43.530    1951-1951/com.example.samitha.cbmessagespro I/dalvikvm﹕ Could not find method android.telephony.SmsCbMessage.createFromPdu, referenced from method com.android.internal.telephony.MainActivity.onReceive
  06-21 23:32:43.530    1951-1951/com.example.samitha.cbmessagespro W/dalvikvm﹕ VFY: unable to resolve static method 10876: Landroid/telephony/SmsCbMessage;.createFromPdu ([B)Landroid/telephony/SmsCbMessage;
  06-21 23:32:43.530    1951-1951/com.example.samitha.cbmessagespro W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41784c68)
  06-21 23:32:45.580    1951-1951/com.example.samitha.cbmessagespro I/Process﹕ Sending signal. PID: 1951 SIG: 9
  </code></pre>
  
  <p>How to solve this?</p>
  
  <p>Not that I also included all the required dependent classes too when using that SmsCbMessage.java class.</p>