use of com.microsoft.graph.snippets.application.SnippetApp in project android-java-snippets-sample by microsoftgraph.
the class MessageSnippets method createMessageObject.
private static Message createMessageObject() {
// Get a context so we can interrogate Resources & SharedPreferences
SnippetApp app = SnippetApp.getApp();
SharedPreferences prefs = SharedPrefsUtil.getSharedPreferences();
Message message = new Message();
Recipient recipient = new Recipient();
recipient.emailAddress = new EmailAddress();
recipient.emailAddress.address = prefs.getString(SharedPrefsUtil.PREF_USER_ID, "");
message.toRecipients = Collections.singletonList(recipient);
message.subject = app.getString(R.string.mail_subject);
ItemBody itemBody = new ItemBody();
itemBody.contentType = BodyType.text;
itemBody.content = app.getString(R.string.mail_body);
message.body = itemBody;
return message;
}
Aggregations