当前位置: 首页>>代码示例>>C#>>正文


C# android.getString方法代码示例

本文整理汇总了C#中android.getString方法的典型用法代码示例。如果您正苦于以下问题:C# android.getString方法的具体用法?C# android.getString怎么用?C# android.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android的用法示例。


在下文中一共展示了android.getString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getPercent

		private static float getPercent(android.content.res.TypedArray a, int name)
		{
			string s = a.getString(name);
			if (s != null)
			{
				if (s.EndsWith("%"))
				{
					string f = Sharpen.StringHelper.Substring(s, 0, s.Length - 1);
					return float.Parse(f) / 100.0f;
				}
			}
			return -1;
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:13,代码来源:ScaleDrawable.cs

示例2: convertToString

		public override java.lang.CharSequence convertToString(android.database.Cursor cursor
			)
		{
			if (mCursorToStringConverter != null)
			{
				return mCursorToStringConverter.convertToString(cursor);
			}
			else
			{
				if (mStringConversionColumn > -1)
				{
					return java.lang.CharSequenceProxy.Wrap(cursor.getString(mStringConversionColumn)
						);
				}
			}
			return base.convertToString(cursor);
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:17,代码来源:SimpleCursorAdapter.cs

示例3: bindView

		public override void bindView(android.view.View view, android.content.Context context
			, android.database.Cursor cursor)
		{
			android.widget.SimpleCursorAdapter.ViewBinder binder = mViewBinder;
			int count = mTo.Length;
			int[] from = mFrom;
			int[] to = mTo;
			{
				for (int i = 0; i < count; i++)
				{
					android.view.View v = view.findViewById(to[i]);
					if (v != null)
					{
						bool bound = false;
						if (binder != null)
						{
							bound = binder.setViewValue(v, cursor, from[i]);
						}
						if (!bound)
						{
							string text = cursor.getString(from[i]);
							if (text == null)
							{
								text = string.Empty;
							}
							if (v is android.widget.TextView)
							{
								setViewText((android.widget.TextView)v, text);
							}
							else
							{
								if (v is android.widget.ImageView)
								{
									setViewImage((android.widget.ImageView)v, text);
								}
								else
								{
									throw new System.InvalidOperationException(v.GetType().FullName + " is not a " + 
										" view that can be bounds by this SimpleCursorAdapter");
								}
							}
						}
					}
				}
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:46,代码来源:SimpleCursorAdapter.cs

示例4: bindView

		private void bindView(android.view.View view, android.content.Context context, android.database.Cursor
			 cursor, int[] from, int[] to)
		{
			android.widget.SimpleCursorTreeAdapter.ViewBinder binder = mViewBinder;
			{
				for (int i = 0; i < to.Length; i++)
				{
					android.view.View v = view.findViewById(to[i]);
					if (v != null)
					{
						bool bound = false;
						if (binder != null)
						{
							bound = binder.setViewValue(v, cursor, from[i]);
						}
						if (!bound)
						{
							string text = cursor.getString(from[i]);
							if (text == null)
							{
								text = string.Empty;
							}
							if (v is android.widget.TextView)
							{
								setViewText((android.widget.TextView)v, text);
							}
							else
							{
								if (v is android.widget.ImageView)
								{
									setViewImage((android.widget.ImageView)v, text);
								}
								else
								{
									throw new System.InvalidOperationException("SimpleCursorTreeAdapter can bind values"
										 + " only to TextView and ImageView!");
								}
							}
						}
					}
				}
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:43,代码来源:SimpleCursorTreeAdapter.cs

示例5: getStringOrNull

		private static string getStringOrNull(android.database.Cursor cursor, int col)
		{
			if (col == INVALID_INDEX)
			{
				return null;
			}
			try
			{
				return cursor.getString(col);
			}
			catch (System.Exception e)
			{
				android.util.Log.e(LOG_TAG, "unexpected error retrieving valid column from cursor, "
					 + "did the remote process die?", e);
				return null;
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:17,代码来源:SuggestionsAdapter.cs

示例6: getIcon2

		private android.graphics.drawable.Drawable getIcon2(android.database.Cursor cursor
			)
		{
			if (mIconName2Col == INVALID_INDEX)
			{
				return null;
			}
			string value = cursor.getString(mIconName2Col);
			return getDrawableFromResourceValue(value);
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:10,代码来源:SuggestionsAdapter.cs

示例7: getIcon1

		private android.graphics.drawable.Drawable getIcon1(android.database.Cursor cursor
			)
		{
			if (mIconName1Col == INVALID_INDEX)
			{
				return null;
			}
			string value = cursor.getString(mIconName1Col);
			android.graphics.drawable.Drawable drawable = getDrawableFromResourceValue(value);
			if (drawable != null)
			{
				return drawable;
			}
			return getDefaultIcon1(cursor);
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:15,代码来源:SuggestionsAdapter.cs


注:本文中的android.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。