Skip to content

Commit

Permalink
Fixed email problem
Browse files Browse the repository at this point in the history
  • Loading branch information
fei0316 committed Jun 28, 2020
1 parent ac44361 commit a66617f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Toast;

import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.annotation.NonNull;
Expand Down Expand Up @@ -77,7 +79,7 @@ public void onCreatePreferences(Bundle bundle, String s) {
}

Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
emailIntent.setType("*/*");
emailIntent.setData(Uri.parse("mailto:"));
PackageManager packageManager = requireActivity().getPackageManager();
if(emailIntent.resolveActivity(packageManager) == null){
Preference mail = findPreference("edit_text_preference_8");
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/xml/about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@
app:iconSpaceReserved="false"
android:summary="@string/about_email"
android:title="@string/about_contact">

<intent
android:action="android.intent.action.VIEW"
android:data="mailto:[email protected]" />

</Preference>
<Preference
android:layout_width="wrap_content"
Expand Down

0 comments on commit a66617f

Please sign in to comment.