I wish that clicking on a preference you may be directed towards a service to send emails such as gmail. Here is what I did
Preference email;
email = (Preference) this.findPreference("email");
email.setOnPreferenceClickListener(new OnPreferenceClickListener()); {
Intent emailIntent = new Intent( android.content.Intent.ACTION_SEND);
String[] recipients = new String[]{"" , "MY-EMAIL@gmail.com" ,};
emailIntent.putExtra( android.content.Intent.EXTRA_EMAIL, recipients);
emailIntent.putExtra( android.content.Intent.EXTRA_SUBJECT, "This is my text" );
emailIntent.putExtra( android.content.Intent.EXTRA_TEXT, "");
emailIntent.setType("message/rfc822");
startActivity( Intent.createChooser(emailIntent, "Send Email" ));
}
}
}
I receive error in this line:
email.setOnPreferenceClickListener(new OnPreferenceClickListener()); {
Why? How can i fix it? Thanks a lot