[android-developers] About to receive the mms
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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: invoke other apk file?
Use this function: public int startActivity(String packageName, String className) { Intent intent = new Intent(android.intent.action.MAIN); intent.setClassName(packageName, className); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT ); startActivity(intent); return 0; } On Jul 6, 11:03 am, tstanly tsai.sta...@gmail.com wrote: hi all, I design two apk for a.apk and b.apk, but now I want to invoke b.apk from a.apk, to do that,I will put a Button in a.apk, when user click the button,then goes to b.apk. how can I do that? thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: invoke other apk file?
You must know the package name and activity name On Jul 6, 1:25 pm, tstanly tsai.sta...@gmail.com wrote: thanks. if i don't know the package name,class name.. just knows names xxx.apk is it can work? On 7月6日, 下午12時30分, Piano Pan piano...@gmail.com wrote: Use this function: public int startActivity(String packageName, String className) { Intent intent = new Intent(android.intent.action.MAIN); intent.setClassName(packageName, className); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT ); startActivity(intent); return 0; } On Jul 6, 11:03 am, tstanly tsai.sta...@gmail.com wrote: hi all, I design two apk for a.apk and b.apk, but now I want to invoke b.apk from a.apk, to do that,I will put a Button in a.apk, when user click the button,then goes to b.apk. how can I do that? thanks!- 隱藏被引用文字 - - 顯示被引用文字 - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---