本文整理汇总了C#中android.resolveTypeIfNeeded方法的典型用法代码示例。如果您正苦于以下问题:C# android.resolveTypeIfNeeded方法的具体用法?C# android.resolveTypeIfNeeded怎么用?C# android.resolveTypeIfNeeded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android
的用法示例。
在下文中一共展示了android.resolveTypeIfNeeded方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
public override java.util.List<android.content.pm.ResolveInfo> queryIntentActivityOptions
(android.content.ComponentName caller, android.content.Intent[] specifics, android.content.Intent
intent, int flags)
{
android.content.ContentResolver resolver = mContext.getContentResolver();
string[] specificTypes = null;
if (specifics != null)
{
int N = specifics.Length;
{
for (int i = 0; i < N; i++)
{
android.content.Intent sp = specifics[i];
if (sp != null)
{
string t = sp.resolveTypeIfNeeded(resolver);
if (t != null)
{
if (specificTypes == null)
{
specificTypes = new string[N];
}
specificTypes[i] = t;
}
}
}
}
}
try
{
return mPM.queryIntentActivityOptions(caller, specifics, specificTypes, intent, intent
.resolveTypeIfNeeded(resolver), flags);
}
catch (android.os.RemoteException e)
{
throw new java.lang.RuntimeException("Package manager has died", e);
}
}
示例2: startActivityIfNeeded
public virtual bool startActivityIfNeeded(android.content.Intent intent, int requestCode
)
{
if (mParent == null)
{
int result = android.app.IActivityManagerClass.START_RETURN_INTENT_TO_CALLER;
try
{
intent.setAllowFds(false);
result = android.app.ActivityManagerNative.getDefault().startActivity(mMainThread
.getApplicationThread(), intent, intent.resolveTypeIfNeeded(getContentResolver()
), null, 0, mToken, mEmbeddedID, requestCode, true, false, null, null, false);
}
catch (android.os.RemoteException)
{
}
android.app.Instrumentation.checkStartActivityResult(result, intent);
if (requestCode >= 0)
{
mStartedActivity = true;
}
return result != android.app.IActivityManagerClass.START_RETURN_INTENT_TO_CALLER;
}
throw new System.NotSupportedException("startActivityIfNeeded can only be called from a top-level activity"
);
}
示例3: resolveActivity
public override android.content.pm.ResolveInfo resolveActivity(android.content.Intent
intent, int flags)
{
try
{
return mPM.resolveIntent(intent, intent.resolveTypeIfNeeded(mContext.getContentResolver
()), flags);
}
catch (android.os.RemoteException e)
{
throw new java.lang.RuntimeException("Package manager has died", e);
}
}
示例4: bindService
public override bool bindService(android.content.Intent service, android.content.ServiceConnection
conn, int flags)
{
android.app.IServiceConnection sd;
if (mPackageInfo != null)
{
sd = mPackageInfo.getServiceDispatcher(conn, getOuterContext(), mMainThread.getHandler
(), flags);
}
else
{
throw new java.lang.RuntimeException("Not supported in system context");
}
try
{
android.os.IBinder token = getActivityToken();
if (token == null && (flags & BIND_AUTO_CREATE) == 0 && mPackageInfo != null && mPackageInfo
.getApplicationInfo().targetSdkVersion < android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH)
{
flags |= BIND_WAIVE_PRIORITY;
}
service.setAllowFds(false);
int res = android.app.ActivityManagerNative.getDefault().bindService(mMainThread.
getApplicationThread(), getActivityToken(), service, service.resolveTypeIfNeeded
(getContentResolver()), sd, flags);
if (res < 0)
{
throw new System.Security.SecurityException("Not allowed to bind to service " + service
);
}
return res != 0;
}
catch (android.os.RemoteException)
{
return false;
}
}
示例5: startIntentSenderForResultInner
private void startIntentSenderForResultInner(android.content.IntentSender intent,
int requestCode, android.content.Intent fillInIntent, int flagsMask, int flagsValues
, android.app.Activity activity)
{
try
{
string resolvedType = null;
if (fillInIntent != null)
{
fillInIntent.setAllowFds(false);
resolvedType = fillInIntent.resolveTypeIfNeeded(getContentResolver());
}
int result = android.app.ActivityManagerNative.getDefault().startActivityIntentSender
(mMainThread.getApplicationThread(), intent, fillInIntent, resolvedType, mToken,
activity.mEmbeddedID, requestCode, flagsMask, flagsValues);
if (result == android.app.IActivityManagerClass.START_CANCELED)
{
throw new android.content.IntentSender.SendIntentException();
}
android.app.Instrumentation.checkStartActivityResult(result, null);
}
catch (android.os.RemoteException)
{
}
if (requestCode >= 0)
{
mStartedActivity = true;
}
}
示例6: stopService
public override bool stopService(android.content.Intent service)
{
try
{
service.setAllowFds(false);
int res = android.app.ActivityManagerNative.getDefault().stopService(mMainThread.
getApplicationThread(), service, service.resolveTypeIfNeeded(getContentResolver(
)));
if (res < 0)
{
throw new System.Security.SecurityException("Not allowed to stop service " + service
);
}
return res != 0;
}
catch (android.os.RemoteException)
{
return false;
}
}
示例7: startService
public override android.content.ComponentName startService(android.content.Intent
service)
{
try
{
service.setAllowFds(false);
android.content.ComponentName cn = android.app.ActivityManagerNative.getDefault()
.startService(mMainThread.getApplicationThread(), service, service.resolveTypeIfNeeded
(getContentResolver()));
if (cn != null && cn.getPackageName().Equals("!"))
{
throw new System.Security.SecurityException("Not allowed to start service " + service
+ " without permission " + cn.getClassName());
}
return cn;
}
catch (android.os.RemoteException)
{
return null;
}
}
示例8: removeStickyBroadcast
public override void removeStickyBroadcast(android.content.Intent intent)
{
string resolvedType = intent.resolveTypeIfNeeded(getContentResolver());
if (resolvedType != null)
{
intent = new android.content.Intent(intent);
intent.setDataAndType(intent.getData(), resolvedType);
}
try
{
intent.setAllowFds(false);
android.app.ActivityManagerNative.getDefault().unbroadcastIntent(mMainThread.getApplicationThread
(), intent);
}
catch (android.os.RemoteException)
{
}
}
示例9: sendStickyBroadcast
public override void sendStickyBroadcast(android.content.Intent intent)
{
string resolvedType = intent.resolveTypeIfNeeded(getContentResolver());
try
{
intent.setAllowFds(false);
android.app.ActivityManagerNative.getDefault().broadcastIntent(mMainThread.getApplicationThread
(), intent, resolvedType, null, android.app.Activity.RESULT_OK, null, null, null
, false, true);
}
catch (android.os.RemoteException)
{
}
}
示例10: startIntentSender
public override void startIntentSender(android.content.IntentSender intent, android.content.Intent
fillInIntent, int flagsMask, int flagsValues, int extraFlags)
{
try
{
string resolvedType = null;
if (fillInIntent != null)
{
fillInIntent.setAllowFds(false);
resolvedType = fillInIntent.resolveTypeIfNeeded(getContentResolver());
}
int result = android.app.ActivityManagerNative.getDefault().startActivityIntentSender
(mMainThread.getApplicationThread(), intent, fillInIntent, resolvedType, null, null
, 0, flagsMask, flagsValues);
if (result == android.app.IActivityManagerClass.START_CANCELED)
{
throw new android.content.IntentSender.SendIntentException();
}
android.app.Instrumentation.checkStartActivityResult(result, null);
}
catch (android.os.RemoteException)
{
}
}