Retrieve the android.intent.extra.email value from the package

I created an application, such as an email client application, such as gmail

When the user clicks an e-mail address in another application and selects my application from the e-mail sending application, it appears in the list

E - mail content (such as e - mail address, e - mail subject, and...) is deliberately sent to my application

But the problem is intent. Getdata(); It's always null. I try to get email data from intent

I tested the bundle of intent and found that it is not null, and when writing this Code:

bundle = intent.getExtras();
                Log.e("Email",bundle.toString());

Bundle. Tostring() returns bundle [{Android. Intent. Extra. Email = [ljava. Lang. string; @ 11cda76c}]

I don't know what this is [ljava. Lang. string; @ 11cda76c}, and how to get an email address from here?

resolvent:

Passing values through bundle and get its value on other activity

bundle = this.getIntent().getExtras();
String email= bundle.getString("EMAIL");

Edit:

bundle = this.getIntent().getExtras();
String [] emails=bundle.getStringArray(Intent.EXTRA_EMAIL );

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>