本文整理匯總了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");
}
}