Commit 1f7cb7b3 authored by Lucas NAURY's avatar Lucas NAURY

Remplacement de l'Intent SMS

parent e1bc847a
...@@ -58,11 +58,9 @@ public class DetailScreen extends AppCompatActivity { ...@@ -58,11 +58,9 @@ public class DetailScreen extends AppCompatActivity {
binding.smsButton.setOnClickListener(new View.OnClickListener() { binding.smsButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View arg0) { public void onClick(View arg0) {
Intent smsIntent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.parse("smsto:" + annonce.getNumeroTelephone());
smsIntent.setData(Uri.parse("sms:")); Intent smsIntent = new Intent(Intent.ACTION_SENDTO, uri);
smsIntent.setType("vnd.android-dir/mms-sms"); smsIntent.putExtra("sms_body", "Bonjour,\nJe suis intéressé par votre annonce \""+ annonce.getTitre()+"\", n'hésitez pas à me recontacter. \n\n Merci");
smsIntent.putExtra(Intent.EXTRA_TEXT, "");
smsIntent.putExtra("address", annonce.getNumeroTelephone());
startActivity(smsIntent); startActivity(smsIntent);
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment