我有下面的代码,它只是打开我的gmail的邮件发送屏幕,我不想那样。 其实我想在onClick
期间发送即时邮件给邮件标识。 这可能吗?帮助please.Thanks提前。 我是否需要添加任何权限?在Onclick期间自动发送邮件到[email protected] ,,,,,
package com.example.emails;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class Emails extends Activity {
private static Button email;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_emails);
email= (Button)findViewById(R.id.button1);
email.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{ "[email protected]"});
//email.putExtra(Intent.EXTRA_CC, new String[]{ to});
//email.putExtra(Intent.EXTRA_BCC, new String[]{to});
email.putExtra(Intent.EXTRA_SUBJECT, "new mail");
email.putExtra(Intent.EXTRA_TEXT, "hello");
//need this to prompts email client only
email.setType("message/rfc822");
startActivity(Intent.createChooser(email, "Choose an Email client :"));
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.emails, menu);
return true;
}
}
正在开发Android应用程序,,,在应用程序注册画面,,,后 注册过程完成,,,我想送电子邮件提醒管理员,, admin @ gmail.com ,,, –