Added code to send invite SMS
This commit is contained in:
parent
4b3a918e7c
commit
49fa428615
2 changed files with 10 additions and 1 deletions
|
@ -167,6 +167,7 @@
|
|||
<string name="contact_last_name">Last name</string>
|
||||
<string name="contact_organization">Organization</string>
|
||||
<string name="invite_friend">Invite</string>
|
||||
<string name="invite_friend_text">Hello, join me on Linphone! You can download it at http://www.linphone.org/technical-corner/linphone/downloads</string>
|
||||
|
||||
<!-- Chat -->
|
||||
<string name="no_chat_history">No conversations</string>
|
||||
|
|
|
@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.app.Fragment;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -226,10 +228,16 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
v.findViewById(R.id.inviteFriend).setVisibility(View.GONE);
|
||||
if (!noa.isSIPAddress() && v.findViewById(R.id.friendLinphone).getVisibility() == View.GONE) {
|
||||
v.findViewById(R.id.inviteFriend).setVisibility(View.VISIBLE);
|
||||
v.findViewById(R.id.inviteFriend).setTag(noa.getNormalizedPhone());
|
||||
v.findViewById(R.id.inviteFriend).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//TODO
|
||||
String number = (String)v.getTag();
|
||||
Intent smsIntent = new Intent(Intent.ACTION_SENDTO);
|
||||
smsIntent.putExtra("address", number);
|
||||
smsIntent.setData(Uri.parse("smsto:" + number));
|
||||
smsIntent.putExtra("sms_body", getString(R.string.invite_friend_text));
|
||||
startActivity(smsIntent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue