Do you have the following in your AndroidManifest.xml file? <uses-permission android:name="android.permission.RECEIVE_MMS"/>
-- Jack Ha Open Source Development Center ・T・ ・ ・Mobile・ stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 31, 1:45 am, Piano Pan <[email protected]> wrote: > I use the BroadcastReceiver to get the MMS information, but the > onReceive can not get the message when MMS coming. > > Code as following: > > private static final String ACTION_SMS_RECEIVED = > "android.provider.Telephony.SMS_RECEIVED"; > private static final String ACTION_MMS_RECEIVED = > "android.provider.Telephony.WAP_PUSH_RECEIVED"; > private static final String MMS_DATA_TYPE = > "application/vnd.wap.mms-message"; > > public int RegistReceiver() > { > > IntentFilter filter = new IntentFilter(); > filter.addAction(ACTION_MMS_RECEIVED); > filter.addAction(ACTION_SMS_RECEIVED); > try { > filter.addDataType(MMS_DATA_TYPE); > } catch (MalformedMimeTypeException e){ > } > this.registerReceiver(this.mReceiver, filter); > return 0; > } > public int UnregisterReceiver() > { > this.unregisterReceiver(this.mReceiver); > return 0; > } > > class MSGTestReceiver extends BroadcastReceiver > { > > @Override > public void onReceive(Context context, Intent intent) { > > String action = intent.getAction(); > String dataType = intent.getType(); > if (ACTION_SMS_RECEIVED.equals(action)) > { > MDebug.V("Message is a SMS"); > } else { > MDebug.V("Message is a MMS"); > } > } > > } > > This code can work when SMS coming. Does anybody give me some > comments? > > Regards > > Pan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

