Security Exception with tabbar one touch email composer
<p>My goal is that on a tabbar when you push the tabs different activities show but on one of them I want no activity just an email account chooser to show leading to the email composer.</p>

<p>My current method is working on 2.2 and 2.3 but not on anything higher. So on a Galaxy 3s I get</p>

<pre><code> Caused by: java.lang.SecurityException: Given caller package android is not running in process ProcessRecord{}
</code></pre>

<p>Here is my current code, I am up for doing a better way also if you have constructive criticism.</p>

<p>public class myTabbar extends TabActivity {</p>

<pre><code>TabHost tabHost;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    tabHost = getTabHost();
    setTabs();
}

private void setTabs() {
    addTab("Home", R.drawable.home, Home_Page_Activity.class);
    addTab("Map", R.drawable.map, Map_Locations_Activity.class);
    addTab("Email", R.drawable.email, Email_From_Tab.class);    
    addTab("Input", R.drawable.suggestions, Suggestions_Activity.class);
    addTab("More", R.drawable.more, More.class);
}

private void addTab(String labelId, int drawableId, Class&lt;?&gt; c) {           
        Intent intent = new Intent(this, c);
        TabHost.TabSpec spec = tabHost.newTabSpec("tab" + labelId);     
        View tabIndicator = LayoutInflater.from(this).inflate(R.layout.tab_indicator, getTabWidget(), false);
        TextView title = (TextView) tabIndicator.findViewById(R.id.title);
        title.setText(labelId);
        ImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);
        icon.setImageResource(drawableId);      
        spec.setIndicator(tabIndicator);
        if(c == Email_From_Tab.class){
            Intent it=new Intent(Intent.ACTION_SEND);     
            String[] tos={"email@emael.com"};     
            String[] ccs={"email@emael.com"};     
            it.putExtra(Intent.EXTRA_EMAIL, tos);     
            it.putExtra(Intent.EXTRA_CC, ccs);     
            it.putExtra(Intent.EXTRA_TEXT, "The email body text");     
            it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text"); 
            it.setType("message/rfc822"); 

            spec.setContent(Intent.createChooser(it, "Choose Email Client"));
        }else{
            spec.setContent(intent);
        }
        tabHost.addTab(spec);
}
}
</code></pre>
