Code example for Activity

Methods: getString

0
        if (IgnitedIntents.isIntentAvailable(activity, Intent.ACTION_SEND,
                IgnitedIntents.MIME_TYPE_EMAIL)) { 
            String buttonText = activity.getString(R.string.ign_error_report_send_button);
            String bugReportEmailSubject = activity.getString(
                    R.string.ign_error_report_email_subject, error.getClass().getName());
            final String diagnosis = IgnitedDiagnostics.createDiagnosis(activity, error);
            final Intent intent = IgnitedIntents.newEmailIntent(activity, emailAddress,
                    bugReportEmailSubject, diagnosis);
            builder.setNegativeButton(buttonText, new OnClickListener() {
 
                @Override 
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                    activity.startActivity(intent);
                } 
            }); 
        } 
 
        return builder;
    } 
 
    public static AlertDialog.Builder newErrorHandlerDialog(final Activity activity, int titleId,
            String emailAddress, Exception error) {
        return newErrorHandlerDialog(activity, activity.getString(titleId), emailAddress, error);
    } 
 
    /** 
     * Creates a AlertDialog that shows a list of elements. The listener's onClick method gets 
     * called when the user taps a list item. 
     *  
     * @param <T> 
     *            The type of each element 
     * @param context 
     * @param title 
     *            the title or null to disable the title