sending a keyword to bring the location

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


sending a keyword to bring the location



hello every one



**i want to send a keyword in a message that bring me the location of the reciever when the message will send i don t know how to add this option in my code **



i have my own map that i created with fragment that gives you your position



this is my main activity


import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class Main3Activity extends AppCompatActivity {

private static final String TAG = Main3Activity.class.getSimpleName();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main3);
}

/**
* Uses an implicit intent to dial the phone with the Phone app.
* Gets the phone number from TextView number_to_call.
*
* @param view View (phone_icon) that was clicked.
*/
public void dialNumber(View view) {
TextView textView = (TextView) findViewById(R.id.number_to_call);
// Use format with "tel:" and phone number to create phoneNumber.
String phoneNumber = String.format("tel: %s", textView.getText().toString());
// Create the intent.
Intent callIntent = new Intent(Intent.ACTION_DIAL);
// Set the data for the intent as the phone number.
callIntent.setData(Uri.parse(phoneNumber));
// If package resolves to an app, send intent.
if (callIntent.resolveActivity(getPackageManager()) != null) {
startActivity(callIntent);
} else {
Log.e(TAG, "Can't resolve app for ACTION_DIAL Intent.");
}
}

/**
* Uses an implicit intent to send a message with an SMS messaging app.
* Gets the phone number from TextView number_to_call.
*
* @param view View (message_icon) that was clicked.
*/
public void smsSendMessage(View view) {
TextView textView = (TextView) findViewById(R.id.number_to_call);
// Use format with "smsto:" and phone number to create smsNumber.
String smsNumber = String.format("smsto: %s", textView.getText().toString());
// Find the sms_message view.
EditText smsEditText = (EditText) findViewById(R.id.sms_message);
// Get the text of the sms message.
String sms = smsEditText.getText().toString();
// Create the intent.
Intent smsIntent = new Intent(Intent.ACTION_SENDTO);
// Set the data for the intent as the phone number.
smsIntent.setData(Uri.parse(smsNumber));
// Add the message (sms) with the key ("sms_body").
smsIntent.putExtra("sms_body", sms);
// If package resolves to an app, send intent.
if (smsIntent.resolveActivity(getPackageManager()) != null) {
startActivity(smsIntent);
} else {
Log.e(TAG, "Can't resolve app for ACTION_SENDTO Intent.");
}
}
}



thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

C# - How to create a semi transparent or blurred backcolor on windows form

Swipe gestures in WKWebView

How to populate data on nav-tab in partial View in MVC?