Example usage for android.app Fragment getString

List of usage examples for android.app Fragment getString

Introduction

In this page you can find the example usage for android.app Fragment getString.

Prototype

public final String getString(@StringRes int resId) 

Source Link

Document

Return a localized string from the application's package's default string table.

Usage

From source file:net.sf.diningout.app.ui.FriendsFragment.java

private static void sendInvite(List<String> to, Fragment frag) {
    Intent intent = new Intent(ACTION_SENDTO, Uris.mailto(to, null, null,
            frag.getString(R.string.invite_subject), frag.getString(R.string.invite_body)));
    if (Intents.hasActivity(frag.getActivity(), intent)) {
        frag.startActivity(intent);//from w  w  w .  j  ava 2s.c  o m
    }
}

From source file:org.alfresco.mobile.android.application.manager.ActionManager.java

public static boolean actionSendMailWithAttachment(Fragment fr, String subject, String content, Uri attachment,
        int requestCode) {
    try {//from   w  ww.j av a  2s  .  c  o  m
        Intent i = new Intent(Intent.ACTION_SEND);
        i.putExtra(Intent.EXTRA_SUBJECT, subject);
        i.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(content));
        i.putExtra(Intent.EXTRA_STREAM, attachment);
        i.setType("text/plain");
        fr.startActivityForResult(Intent.createChooser(i, fr.getString(R.string.send_email)), requestCode);

        return true;
    } catch (Exception e) {
        MessengerManager.showToast(fr.getActivity(), R.string.decryption_failed);
        Log.d(TAG, Log.getStackTraceString(e));
    }

    return false;
}