How can i use compose email activity in tabView?

后端 未结 2 1151
小蘑菇
小蘑菇 2021-01-27 12:47

I want to display compose email in Tab Activity. It is my code.

        TabHost tabHost=getTabHost();
    TabHost.TabSpec spec;
    Intent intent;

    //View ta         


        
相关标签:
2条回答
  • 2021-01-27 13:19

    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
    
    0 讨论(0)
  • 2021-01-27 13:20

    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();
        }
    }
    
    0 讨论(0)
提交回复
热议问题