Back to project page mac-hopper.
The source code is released under:
MIT License
If you think the Android project mac-hopper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package uk.co.danhawkes.machopper.ui.preferences; //from w w w .jav a 2 s. c o m import uk.co.danhawkes.machopper.R; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.net.Uri; import android.preference.Preference; import android.util.AttributeSet; public class ContactPreference extends Preference { public ContactPreference(Context context) { this(context, null); } public ContactPreference(Context context, AttributeSet attrs) { this(context, attrs, android.R.attr.preferenceStyle); } public ContactPreference(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onClick() { super.onClick(); Resources res = getContext().getResources(); Uri uri = Uri.fromParts("mailto", res.getString(R.string.preference_contact_email), null); Intent intent = new Intent(Intent.ACTION_SENDTO, uri); intent.putExtra(Intent.EXTRA_SUBJECT, res.getString(R.string.app_name)); getContext().startActivity( Intent.createChooser(intent, getContext().getString(R.string.preference_contact_chooser_title))); } }