android intent를 사용하여 이메일을 보내려고합니다. 모든 것은 null 값을 얻지 만 null 값을받는 필드로 보내기에서 전자 메일 앱을 선택할 때를 제외하고는 잘 작동하지만 null 값을 확인했지만 문자열이 null 인 경우이를 감지 할 수없는 것처럼 보입니다. 아무도 내가이 문제를 해결할 수 있도록 도와 줄 수 있습니까?null 인 경우 Android에서 문자열을 찾을 수 없습니다.
if (emailAddress[0]!=null && !emailAddress[0].isEmpty()) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_EMAIL, emailAddress);
intent.putExtra(Intent.EXTRA_SUBJECT,
getResources().getString(R.string.email_sub));
// intent.putExtra(Intent.EXTRA_TEXT, "I'm email body.");
startActivity(Intent.createChooser(intent, "Send Email"));
) { return string! = null &&! string.isEmpty() &&! string.trim(). isEmpty(); } – TronicZomB
사용이 ... 공공 정적 부울 isNotNullNotEmptyNotWhiteSpaceOnlyByJava ( 최종 문자열 문자열이 될 수 있다고 생각하지 않습니다 – itsrajesh4uguys