I tried to launch the sms application using the sms_mail layout from the menu but it not working. is there something missing with my intent or am I using the wrong coding?
menu: details_option.xml
<item
android:id="@+id/sms"
android:icon="@drawable/ic_menu_sms"
android:title="Sms"/>
src: DetailForm.java
} else if (item.getItemId() == R.id.sms) {
Intent smsIntent = new Intent(Intent.ACTION_SENDTO);
smsIntent.addCategory(Intent.CATEGORY_DEFAULT);
smsIntent.setType("vnd.android-dir/mms-sms");
smsIntent.setData(Uri.parse("sms:" + telephone.getText()));
}
return true;
}
Your code is perfectly correct. Just you are not launching the intent. It can be done as
and make sure you have the following permission in your manifest