Created
October 10, 2013 18:40
-
-
Save sakurabird/6923317 to your computer and use it in GitHub Desktop.
(Android)Intentでメールアプリを呼び出す。セキュリティ上好ましい方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onClick1(View view) { | |
// logcatにメールアドレスが表示される呼び出し方。セキュリティ上好ましくない | |
Uri uri = Uri.parse("mailto:" + mail); | |
Intent intent = new Intent(Intent.ACTION_SENDTO, uri); | |
startActivity(intent); | |
} | |
public void onClick2(View view) { | |
// logcatにメールアドレスが表示されない呼び出し方。セキュリティ上好ましい | |
Uri uri = Uri.parse("mailto:"); | |
Intent intent = new Intent(Intent.ACTION_SENDTO, uri); | |
intent.putExtra(Intent.EXTRA_EMAIL, | |
new String[] { | |
}); | |
startActivity(intent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment