本文整理汇总了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;
}
示例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);
}
示例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");
}
}
}
}
}
}
}
示例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!");
}
}
}
}
}
}
}
示例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;
}
}
示例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);
}
示例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);
}