TsCyrille Posted August 13, 2010 Share Posted August 13, 2010 Bonjour Dans mon application je veux ouvrir la saisie d'un SMS : cela est OK. Voici mon code : Intent intent = new Intent(Intent.ACTION_VIEW); intent.putExtra("sms_body", "Ici c'est mon SMS"); intent.setType("vnd.android-dir/mms-sms"); startActivity(intent); Mon texte est bien pré-renseigné. Je veux également pré-renseigner le numéro de téléphone mais je n'y arrive pas. En faisant des recherches, je suis tombé sur cela : Uri smsUri = Uri.parse("tel:060606060"); Intent intent = new Intent(Intent.ACTION_VIEW, smsUri); intent.putExtra("sms_body", "Ici c'est mon SMS"); intent.setType("vnd.android-dir/mms-sms"); startActivity(intent); Mais là aussi je ne récupère pas le numéro de téléphone... Est-ce que quelqu'un aurait une idée ? Merci d'avance Link to comment Share on other sites More sharing options...
Random Posted August 13, 2010 Share Posted August 13, 2010 Essaye plutot : Uri uri = Uri.parse("smsto:0800000123"); Intent it = new Intent(Intent.ACTION_SENDTO, uri); it.putExtra("sms_body", "The SMS text"); startActivity(it); Source : http://snipt.net/Martin/android-intent-usage/ Link to comment Share on other sites More sharing options...
TsCyrille Posted August 13, 2010 Author Share Posted August 13, 2010 Merci beaucoup pour ton aide : cela marche très bien... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.