전자 메일의 본문에 일부 값이있는 ArrayList를 보내려고합니다. 이처럼 :안드로이드에있는 전자 메일 본문에 ArrayList를 보내는 방법은 무엇입니까?
Button bt_send = (Button) findViewById(R.id.bt_cadastrar_medicos);
bt_cadastrar_medicos.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL, "[email protected]");
intent.putExtra(Intent.EXTRA_SUBJECT, "SUBJECT");
ArrayList<String> array = new ArrayList<String>();
for(int i=0; i<2; i++){
String ii = String.valueOf(i);
niveis.add(ii);
niveis.add(ii);
intent.putExtra(Intent.EXTRA_TEXT, niveis.get(i));
}
startActivity(Intent.createChooser(intent, "Choose the app to send:"));
}
});
이 그냥 예이다가, 실제로 내가 추가 할 배열 위치 값이 자바 클래스에서 가져옵니다. 그러나 몸에서 단지 마지막 값이 나타납니다.이 경우에는 "2"가됩니다.
어떻게 몸에 모두 표시합니까? 그게 가능하니?
감사합니다.
와우, 내 코드에서 내 Arraylist의 "문자열"이 누락되었습니다. 그리고 당신도 코드를 사용하고 있습니다. 감사. – user2600853