我正在创建一个应用程序,当我按下按钮时将 TextView 内容发送到我的电子邮件,但我知道如何执行此操作,我需要帮助。
我需要发送到电子邮件 tvFechaSi 和 ImageView 到 wrfrewf@gmail.com(是假电子邮件)
public class FormBotonSi extends Activity {
private String SFecha;
private TextView tvFechaSi ;
private static final int CAMERA_REQUEST = 1888;
private ImageView imageView;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.formbotonsi);
Bundle bundle=getIntent().getExtras();
tvFechaSi=(TextView) findViewById(R.id.tvFechaSi);
Fecha =bundle.getString("Fecha");
tvFechaSi.setText(Fecha.toString());
this.imageView = (ImageView)this.findViewById(R.id.imageView1);
Button photoButton = (Button) this.findViewById(R.id.button1);
Spinner sp = (Spinner) findViewById(R.id.spinner1);
ArrayAdapter adapter = ArrayAdapter.createFromResource(
this, R.array.tipoPrioridad, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp.setAdapter(adapter);
photoButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
}
});
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
imageView.setImageBitmap(photo);
}
}
}