Fragment getString - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getString, setEmptyText
     * 
     * @param resId Identification of string from a resources 
     * @see #setEmptyText(CharSequence) 
     */ 
    public void setEmptyText(int resId) {
        setEmptyText(getString(resId));
    } 
 
    /** 
     * The default content for a ProgressFragment has a TextView that can be shown when 
     * the content is empty {@link #setContentEmpty(boolean)}. 
     * If you would like to have it shown, call this method to supply the text it should use. 
     * 
     * @param text Text for empty view 
     * @see #setEmptyText(int) 
     */ 
    public void setEmptyText(CharSequence text) {
        ensureContent(); 
        if (mEmptyView != null && mEmptyView instanceof TextView) {
            ((TextView) mEmptyView).setText(text);
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getActivity, getString, Fragment.getString
			return "about_sectioned.html"; 
		} 
 
		@Override 
		protected void loadData(StringBuilder data) {
			data.insert(data.length() - 8, getString(R.string.help_dashboard_header_text));
 
			if(!ConfigHelper.isSingleCampaignMode()) 
				addSection(data, "dash_campaigns.png", R.string.help_dashboard_campaigns_title, R.string.help_dashboard_campaigns_text);
 
			UserPreferencesHelper userPrefs = new UserPreferencesHelper(getActivity());
 
			addSection(data, "dash_surveys.png", R.string.help_dashboard_surveys_title, R.string.help_dashboard_surveys_text);
 
			if(userPrefs.showFeedback())
				addSection(data, "dash_resphistory.png", R.string.help_dashboard_response_history_title, R.string.help_dashboard_response_history_text);
 
			if(userPrefs.showUploadQueue())
				addSection(data, "dash_upqueue.png", R.string.help_dashboard_upload_queue_title, R.string.help_dashboard_upload_queue_text);
 

5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getString, setEmptyText
     * 
     * @param resId Identification of string from a resources 
     * @see #setEmptyText(CharSequence) 
     */ 
    public void setEmptyText(int resId) {
        setEmptyText(getString(resId));
    } 
 
    /** 
     * The default content for a ProgressFragment has a TextView that can be shown when 
     * the content is empty {@link #setContentEmpty(boolean)}. 
     * If you would like to have it shown, call this method to supply the text it should use. 
     * 
     * @param text Text for empty view 
     * @see #setEmptyText(int) 
     */ 
    public void setEmptyText(CharSequence text) {
        ensureContent(); 
        if (mEmptyView != null && mEmptyView instanceof TextView) {
            ((TextView) mEmptyView).setText(text);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getString
		((MainActivity) mActivity).showMenu();
	} 
 
	/** 短暂显示Toast提示(来自res) **/ 
	protected void showShortToast(int resId) {
		Toast.makeText(mContext, getString(resId), Toast.LENGTH_SHORT).show();
	} 
 
	/** 短暂显示Toast提示(来自String) **/ 
	protected void showShortToast(String text) {
		Toast.makeText(mContext, text, Toast.LENGTH_SHORT).show();
	} 
 
	/** 长时间显示Toast提示(来自res) **/ 
	protected void showLongToast(int resId) {
		Toast.makeText(mContext, getString(resId), Toast.LENGTH_LONG).show();
	} 
 
	/** 长时间显示Toast提示(来自String) **/ 
	protected void showLongToast(String text) {
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Fragment getString Questions & Answers:

getString Method Overview
Return a localized string from the application's package's default string table.
See Code Examples for other Android Fragment Methods: