신청서에 인 텐트가 포함 된 이메일을 보내려고합니다. 휴대 전화에서는 정상적으로 작동하지만 내 태블릿에서는 작동하지 않습니다. 다음은 메일 의도 코드 :Android 애플리케이션에서 태블릿으로 전화 작업 중이지만 이메일로 보내기가 의도되었습니다.
mail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(android.content.Intent.ACTION_SEND);
intent.setType("text/html");
List<ResolveInfo> resInfo = getPackageManager().queryIntentActivities(intent, 0);
if (!resInfo.isEmpty()) {
for (ResolveInfo info : resInfo) {
if (info.activityInfo.packageName.toLowerCase().contains("email") || info.activityInfo.name.toLowerCase().contains("email")) {
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
intent.setPackage(info.activityInfo.packageName);
startActivity(Intent.createChooser(intent, ""));
}
}
}
}
});
그리고 이것은 전화를위한 나의 레이아웃입니다 :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/mail"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_marginBottom="100dp"
android:layout_gravity="center|bottom"
android:background="@drawable/bakanadanis_button"
android:gravity="center"
android:text="Bakana Ulaşın"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/white"
android:textSize="14dp" />
그리고 배치가 600dp 태블릿 :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/tab_merkezteskilatibg">
<Button
android:id="@+id/mail"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_marginBottom="200dp"
android:layout_gravity="center|bottom"
android:background="@drawable/bakanadanis_button"
android:gravity="center"
android:text="Bakana Ulaşın"
android:textAppearance="?android:attr/textAppearanceMedium"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:textColor="@android:color/white"
android:textSize="18dp" />
아무도 w 알아? 문제가있을 수도 있니? 감사.
크래시가 발생하거나 증상이 정확히 무엇입니까? 로그가 있다면 여기에 붙여 넣으십시오. –
나는 어떤 오류 메시지 나 그와 비슷한 것을 얻지 못한다. 태블릿에서는 작동하지 않는다. 나는 단추를 클릭 할 수 있지만 전자 메일 작업을 보내기 위해 작동하지 않는다. 여기서 문제를 발견하지 못했다. –