Meu codigo que ouve quando um sms chega:
public class SmsReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
Bundle bundle = intent.getExtras();
Object[] pdus = (Object[]) bundle.get("pdus");
SmsMessage message = SmsMessage.createFromPdu((byte[])pdus[0]);
String sms = message.getMessageBody();
Log.v("*** onReceiveSMS", sms);
Toast.makeText(context, "SMS Recebida!", Toast.LENGTH_SHORT).show();
}
}
Mas toda vez que recebe sms, da pau
log:
09-23 00:23:10.870: DEBUG/GoogleLoginService(188): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }
09-23 00:23:10.900: WARN/GoogleLoginService(188): Device has no accounts: sending Intent { act=com.google.android.gsf.LOGIN_ACCOUNTS_MISSING }
09-23 00:23:11.206: DEBUG/Mms:app(250): getSmsNewMessageNotificationInfo: count=1, first addr=[telefone removido], thread_id=1
09-23 00:23:11.640: DEBUG/MediaPlayer(58): Couldn't open file on client side, trying server side
09-23 00:23:11.700: ERROR/MediaPlayerService(33): Couldn't open fd for content://settings/system/notification_sound
09-23 00:23:11.710: ERROR/MediaPlayer(58): Unable to to create media player
09-23 00:23:11.760: WARN/NotificationService(58): error loading sound for content://settings/system/notification_sound
09-23 00:23:11.760: WARN/NotificationService(58): java.io.IOException: setDataSource failed.: status=0x80000000
09-23 00:23:11.760: WARN/NotificationService(58): at android.media.MediaPlayer.setDataSource(Native Method)
09-23 00:23:11.760: WARN/NotificationService(58): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:716)
09-23 00:23:11.760: WARN/NotificationService(58): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:671)
09-23 00:23:11.760: WARN/NotificationService(58): at com.android.server.NotificationPlayer$CreationAndCompletionThread.run(NotificationPlayer.java:88)
09-23 00:23:12.070: DEBUG/dalvikvm(58): GC_FOR_MALLOC freed 7449 objects / 726032 bytes in 128ms
09-23 00:23:15.760: DEBUG/dalvikvm(165): GC_EXPLICIT freed 2414 objects / 140088 bytes in 434ms
estou usando o emulador Google Api 2.2 api level 8. Preciso do google api pois estou usando a api do maps!
alguem pode me ajudar a resolver esse problema???
