本文整理汇总了C#中Android.GetQueryParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Android.GetQueryParameter方法的具体用法?C# Android.GetQueryParameter怎么用?C# Android.GetQueryParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android
的用法示例。
在下文中一共展示了Android.GetQueryParameter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Query
public override Android.Database.ICursor Query (Android.Net.Uri uri, string[] projection, string selection, string[] selectionArgs, string sortOrder)
{
if (LOGV) Log.Verbose(TAG, "query(uri=" + uri + ", proj=" + projection.ToString() + ")");
SQLiteDatabase db = mOpenHelper.ReadableDatabase;
int match = sUriMatcher.Match(uri);
switch (match) {
default: {
// Most cases are handled with simple SelectionBuilder
SelectionBuilder builder = BuildExpandedSelection(uri, match);
return builder.Where(selection, selectionArgs).Query(db, projection, sortOrder);
}
case SEARCH_SUGGEST: {
SelectionBuilder builder = new SelectionBuilder();
// Adjust incoming query to become SQL text match
selectionArgs[0] = selectionArgs[0] + "%";
builder.Table(ScheduleDatabase.Tables.SEARCH_SUGGEST);
builder.Where(selection, selectionArgs);
builder.Map(SearchManager.SuggestColumnQuery,
SearchManager.SuggestColumnText1);
projection = new String[] { BaseColumns.Id, SearchManager.SuggestColumnText1,
SearchManager.SuggestColumnQuery };
String limit = uri.GetQueryParameter(SearchManager.SuggestParameterLimit);
return builder.Query(db, projection, null, null, ScheduleContract.SearchSuggest.DEFAULT_SORT, limit);
}
}
}
示例2: OpenFile
public override ParcelFileDescriptor OpenFile(Android.Net.Uri uri, string mode)
{
switch ((UriMatches)UriMatcher.Match(uri))
{
case UriMatches.GetIcon:
var iconId = (PwIcon)Enum.Parse(typeof(PwIcon), uri.GetQueryParameter(IconIdParameter));
var customIconUuid = new PwUuid(MemUtil.HexStringToByteArray(uri.GetQueryParameter(CustomIconUuidParameter)));
var iconDrawable = _db.DrawableFactory.GetIconDrawable(App.Context.Resources, _db.KpDatabase, iconId, customIconUuid) as BitmapDrawable;
if (iconDrawable != null)
{
var pipe = ParcelFileDescriptor.CreatePipe();
var outStream = new OutputStreamInvoker(new ParcelFileDescriptor.AutoCloseOutputStream(pipe[1]));
ThreadPool.QueueUserWorkItem(state =>
{
iconDrawable.Bitmap.Compress(Bitmap.CompressFormat.Png, 100, outStream);
outStream.Close();
});
return pipe[0];
}
// Couldn't get an icon for some reason.
return null;
default:
throw new ArgumentException("Unknown Uri: " + uri, "uri");
}
}