This code run on 4.4.2
when i run this on Marshmallow
crash not shared location.
shar_btn = (Button) findViewById(R.id.shrbtn);
shar_btn.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
link = formatLocation(getLocation(), getResources().getStringArray(R.array.link_templates)[0]);
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, link);
intent.setType("text/plain");
startActivity(Intent.createChooser(intent, getString(R.string.share_location_via)));
}
});
}