I want to make the button share. When the user clicks on it, the following should be displayed. How to do it? I also want that there would be a specific test, for example, the name application, download from here - the link.
2 answers
Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, "Приложение name, скачивай от сюда - ссылка"); sendIntent.setType("text/plain"); startActivity(Intent.createChooser(sendIntent,"Поделиться")); |
public void newShare(View view) { Intent intent = new Intent("android.intent.action.SEND"); intent.setType("plain/text"); intent.putExtra("android.intent.extra.TEXT", "текст"); startActivity(Intent.createChooser(intent, "Поделится ^-^")); } - ATTENTION! In the error code, you need intent.setType ("text / plain"); What did those who voted for the answer think? Plus ("share"). - Style-7
|
