I want to display compose email in Tab Activity. It is my code.
TabHost tabHost=getTabHost();
TabHost.TabSpec spec;
Intent intent;
//View ta
on tab button click you can call a method
tv_email.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
sendSimpleEmail(tv_email);
}
});
this is a method which is used to open a compose email window ,call this method onClick
public void sendSimpleEmail(View textView) {
try {
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
new String[] { email_add });
startActivity(emailIntent);
} catch (Exception e) {
Toast.makeText(getApplicationContext(),
"First Log in to your Email Account", Toast.LENGTH_LONG)
.show();
}
}