나는 안드로이드 개발의 초보자입니다. 이것은 내 애플 리케이션에 대한 내 코드입니다. 버튼을 초기화하고 앱 의도를 이메일로 보내려고했지만 작동하지 않습니다. 아래에 파일을 공유했습니다. 도와주세요.버튼이 이메일 의도를 실행하지 않습니다.
안드로이드 매니페스트
<activity android:name=".ordernow" android:label="Order Details">
<intent-filter>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
activity_ordernow.xml 레이아웃은
<Button
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textAllCaps="true"
android:id="@+id/email_form"
android:text="Get Quote"
android:onClick="getQuote" />
Ordernow.java는
public void getQuote (View view){
String addresses = "[email protected]";
String subject = "Get Quote Online";
String body = "This is the body text for me";
//Compose email to send to Intraline
Intent intent = new Intent(Intent.ACTION_SENDTO);
//For only email apps to handle the information Also Experiment about using whatsapp
intent.setData(Uri.parse("mailto:"));
intent.putExtra(Intent.EXTRA_EMAIL, addresses);
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_TEXT, body);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
나를 qlitch을 찾을 수 있도록 도와주십시오. 정확한 코드 행을 가진 github의 좋은 요지는 설명 외에 설명 될 수 있습니다.
이 ** 자세히 **, 설명하세요, 작동하지 않는다 "는 의미입니다. – CommonsWare
@commonsWare 전자 메일 응용 프로그램이 열리지 않습니다. 앱이 고장났습니다. 오류 : 서페이스 0x7f593eca4200에 EGL_SWAP_BEHAVIOR을 설정하지 못했습니다. 오류 -EGL_SUCCESS 사실 앱은 상태를 변경하지 않고 계속해서 내 활동을 반복 실행합니다. – omukiguy