LoadMapActivity.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:Stayfit 作者:
protected void sendSMSMessage() {
    Log.i("Send SMS", "");
    String phoneNo = phoneno;
    //String lat = getIntent().getExtras().getString("Latitude");
    //String lng = getIntent().getExtras().getString("Longitude");
    // Replace latitude and longitude values
    Address msgaddress = AskLocationActivity.address1;
    String message = "Shall we run together, Location:"+ "http://maps.google.com/?q="+msgaddress.getLatitude()+","+msgaddress.getLongitude();

    Log.d("Message",message);
    try {
        SmsManager smsManager = SmsManager.getDefault();
        smsManager.sendTextMessage(phoneNo, null, message, null, null);
        Toast.makeText(getApplicationContext(), "Invitation sent.", Toast.LENGTH_LONG).show();
    }

    catch (Exception e) {
        Toast.makeText(getApplicationContext(), "SMS faild, please try again.", Toast.LENGTH_LONG).show();
        e.printStackTrace();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号