Context getText - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Context getText method.

This code example shows how to use the following methods:getText
    private static final int PHONE_PHONETIC_NAME_COLUMN_INDEX = 5;
 
    private CharSequence mUnknownNameText;
 
    public LegacyPhoneNumberListAdapter(Context context) {
        super(context);
        mUnknownNameText = context.getText(android.R.string.unknownName);
    } 
 
    @Override 
    public void configureLoader(CursorLoader loader, long directoryId) {
        loader.setUri(Phones.CONTENT_URI);
        loader.setProjection(PHONES_PROJECTION);
        loader.setSortOrder(Phones.DISPLAY_NAME);
    } 
 
    @Override 
    public String getContactDisplayName(int position) {
        return ((Cursor)getItem(position)).getString(PHONE_DISPLAY_NAME_COLUMN_INDEX);
    } 
7
CodeRank
This code example shows how to use the following methods:getText
        return addTab(info);
    } 
 
    @Override 
    public TabInfo addTab(int title, Class<? extends Fragment> fragmentClass) {
        return addTab(mContext.getText(title), fragmentClass, null);
    } 
 
    @Override 
    public TabInfo addTab(int title, Class<? extends Fragment> fragmentClass,
                          Bundle fragmentArguments) {
        return addTab(mContext.getText(title), fragmentClass, fragmentArguments);
    } 
 
    @Override 
    public TabInfo addTab(TabInfo tabInfo) {
        mTabs.add(tabInfo);
        mActionBar.addTab(makeActionBarTab(tabInfo));
        notifyChanged(); 
        return tabInfo;
6
CodeRank
This code example shows how to use the following methods:getText
    public static final int POSTAL_PHONETIC_NAME_COLUMN_INDEX = 5;
 
    private CharSequence mUnknownNameText;
 
    public LegacyPostalAddressListAdapter(Context context) {
        super(context);
        mUnknownNameText = context.getText(android.R.string.unknownName);
    } 
 
    @Override 
    public void configureLoader(CursorLoader loader, long directoryId) {
        loader.setUri(ContactMethods.CONTENT_URI);
        loader.setProjection(POSTALS_PROJECTION);
        loader.setSortOrder(People.DISPLAY_NAME);
        loader.setSelection(ContactMethods.KIND + "=" + android.provider.Contacts.KIND_POSTAL);
    } 
 
    @Override 
    public String getContactDisplayName(int position) {
        return ((Cursor)getItem(position)).getString(POSTAL_DISPLAY_NAME_COLUMN_INDEX);
7
CodeRank
This code example shows how to use the following methods:getText
    protected static final int PERSON_PRESENCE_STATUS_COLUMN_INDEX = 4;
 
    private CharSequence mUnknownNameText;
 
    public LegacyContactListAdapter(Context context) {
        super(context);
        mUnknownNameText = context.getText(android.R.string.unknownName);
    } 
 
    @Override 
    public void configureLoader(CursorLoader loader, long directoryId) {
        loader.setUri(People.CONTENT_URI);
        loader.setProjection(PEOPLE_PROJECTION);
        loader.setSortOrder(People.DISPLAY_NAME);
    } 
 
    @Override 
    public String getContactDisplayName(int position) {
        return ((Cursor)getItem(position)).getString(PERSON_DISPLAY_NAME_COLUMN_INDEX);
    } 
6
CodeRank
This code example shows how to use the following methods:getText
        } else { 
            if (dialog.isShowing()) {
                dialog.dismiss();
            } 
            // use disconnectListener for the correct profile(s) 
            CharSequence okText = context.getText(android.R.string.ok);
            dialog.setButton(DialogInterface.BUTTON_POSITIVE,
                    okText, disconnectListener);
        } 
        dialog.setTitle(title);
        dialog.setMessage(message);
        dialog.show();
        return dialog;
    } 
 
    // TODO: wire this up to show connection errors... 
    static void showConnectingError(Context context, String name) {
        // if (!mIsConnectingErrorPossible) { 
        //     return; 
        // } 
6
CodeRank
This code example shows how to use the following methods:getText
    /** 
     * Update the text in a AppMsg that was previously created using one of the makeText() methods. 
     * @param resId The new text for the AppMsg. 
     */ 
    public void setText(int resId) {
        setText(mContext.getText(resId));
    } 
     
    /** 
     * Update the text in a AppMsg that was previously created using one of the makeText() methods. 
     * @param s The new text for the AppMsg. 
     */ 
    public void setText(CharSequence s) {
        if (mView == null) {
            throw new RuntimeException("This AppMsg was not created with AppMsg.makeText()");
        } 
        TextView tv = (TextView) mView.findViewById(android.R.id.message);
        if (tv == null) {
            throw new RuntimeException("This AppMsg was not created with AppMsg.makeText()");
        } 
6
CodeRank

Related Context getText Questions & Answers:

getText Method Overview
Return a localized, styled CharSequence from the application's package's default string table.
See Code Examples for other Android Context Methods: