I want to display compose email in Tab Activity. It is my code.
TabHost tabHost=getTabHost();
TabHost.TabSpec spec;
Intent intent;
//View ta
In your Application Manifest write the below lines,
android:sharedUserId="android.uid.shared" android:sharedUserLabel="@string/sharedUserLabel"
The sharedUserId parameter is used to share the code,process,data between two apps. So thes code will apply in both the apps.
and also write these lines in your .mk file of both the apps...
LOCAL_CERTIFICATE := shared
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();
}
}