-6

My app contain 2 spinner have array items.

How can I send the data selected in the spinner to email others?

    spinner_list = (Spinner) findViewById(R.id.spinner);
    adapterlist = ArrayAdapter.createFromResource(this, R.array.List, android.R.layout.simple_spinner_item);
    spinner_list.setAdapter(adapterlist);
    spinner_blok = (Spinner) findViewById(R.id.spinner2);
    adapterblok = ArrayAdapter.createFromResource(this, R.array.Blok, android.R.layout.simple_spinner_item);
    spinner_blok.setAdapter(adapterblok);

    String emailList[] = {"nazrin239@gmail.com"};
    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("message/rfc822");
    intent.putExtra(Intent.EXTRA_EMAIL, emailList);
    intent.putExtra(Intent.EXTRA_SUBJECT, "Email Subject");
    intent.putExtra(Intent.EXTRA_TEXT, "Email Text");
    startActivity(Intent.createChooser(intent, "Choice email APP"));
}
}
YoungHobbit
  • 13,254
  • 9
  • 50
  • 73

2 Answers2

0

try this

Intent.putExtra("Key", Value);

for example

Intent.putExtra("Name","John")
Madhawa Priyashantha
  • 9,633
  • 7
  • 33
  • 60
Hemant Ukey
  • 328
  • 4
  • 15
0

use this line to get selected item from spinner

String str=spinner.getSelectedItem().toString();
Ali Ahmad
  • 1,351
  • 9
  • 11
  • but it only show the item from the list..how can i display the data each line from both spinner?thank you for your help – nerzhull239 Dec 02 '15 at 14:09