本文整理汇总了Java中android.content.Intent.getScheme方法的典型用法代码示例。如果您正苦于以下问题:Java Intent.getScheme方法的具体用法?Java Intent.getScheme怎么用?Java Intent.getScheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.Intent
的用法示例。
在下文中一共展示了Intent.getScheme方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: queryIntentFromList
import android.content.Intent; //导入方法依赖的package包/类
public List<R> queryIntentFromList(Intent intent, String resolvedType,
boolean defaultOnly, ArrayList<F[]> listCut) {
ArrayList<R> resultList = new ArrayList<R>();
final boolean debug = localLOGV ||
((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);
FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
final String scheme = intent.getScheme();
int N = listCut.size();
for (int i = 0; i < N; ++i) {
buildResolveList(intent, categories, debug, defaultOnly,
resolvedType, scheme, listCut.get(i), resultList);
}
sortResults(resultList);
return resultList;
}
示例2: initMParams
import android.content.Intent; //导入方法依赖的package包/类
public static void initMParams(Activity activity, Intent intent) {
if (intent != null && intent.getData() != null) {
BaseApplication.setAppStartTime(System.currentTimeMillis());
Uri data = intent.getData();
LogInfo.log("zhuqiao", "M data" + data);
String scheme = intent.getScheme();
if (scheme != null && "letvclient".equalsIgnoreCase(scheme)) {
DownloadManager.pauseAllDownload();
}
if (TextUtils.equals(data.getQueryParameter("version"), "2.0")) {
mLetvFunctionVersion2(activity, data, intent);
} else {
mLetvFunctionVersion1(activity, data, intent);
}
}
}
示例3: onResume
import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
//loadOAuth();
Intent intent = getIntent();
String scheme = intent.getScheme();
OAuth savedToken = getOAuthToken();
if (CALLBACK_SCHEME.equals(scheme) && (savedToken == null || savedToken.getUser() == null)) {
Uri uri = intent.getData();
String query = uri.getQuery();
String[] data = query.split("&"); //$NON-NLS-1$
if (data != null && data.length == 2) {
String oauthToken = data[0].substring(data[0].indexOf("=") + 1); //$NON-NLS-1$
String oauthVerifier = data[1]
.substring(data[1].indexOf("=") + 1); //$NON-NLS-1$
logger.debug("OAuth Token: {}; OAuth Verifier: {}", oauthToken, oauthVerifier); //$NON-NLS-1$
OAuth oauth = getOAuthToken();
if (oauth != null && oauth.getToken() != null && oauth.getToken().getOauthTokenSecret() != null) {
GetOAuthTokenTask task = new GetOAuthTokenTask(this);
task.execute(oauthToken, oauth.getToken().getOauthTokenSecret(), oauthVerifier);
}
}
}
}
示例4: queryIntentFromList
import android.content.Intent; //导入方法依赖的package包/类
public List<R> queryIntentFromList(Intent intent, String resolvedType,
boolean defaultOnly, ArrayList<F[]> listCut, int userId) {
ArrayList<R> resultList = new ArrayList<R>();
final boolean debug = localLOGV ||
((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);
FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
final String scheme = intent.getScheme();
int N = listCut.size();
for (int i = 0; i < N; ++i) {
buildResolveList(intent, categories, debug, defaultOnly,
resolvedType, scheme, listCut.get(i), resultList, userId);
}
sortResults(resultList);
return resultList;
}
示例5: resolveUri
import android.content.Intent; //导入方法依赖的package包/类
private void resolveUri(Intent intent, Uri data) {
String scheme = intent.getScheme();
if (scheme != null && "letvclient".equalsIgnoreCase(scheme)) {
String actionType = "";
String appName = "";
String title = "";
String officialSite = "";
String text = "";
String imgUrl = "";
String playUrl = "";
String from = "";
try {
actionType = data.getQueryParameter("actionType");
appName = data.getQueryParameter("appName");
title = data.getQueryParameter("title");
officialSite = data.getQueryParameter("officialSite");
text = data.getQueryParameter("text");
imgUrl = data.getQueryParameter("imgUrl");
playUrl = data.getQueryParameter("playUrl");
from = data.getQueryParameter("from");
packageName = data.getQueryParameter("package");
invoker = data.getQueryParameter("invoker");
LogInfo.log("fornia", "ShareAllChannelActivity getIntent()" + actionType + "|" + appName + "|" + title + "|" + officialSite + "|" + text + "|" + imgUrl + "|" + playUrl + "|" + packageName + "|" + invoker + "|" + from);
share2Channel(actionType, appName, title, officialSite, text, imgUrl, playUrl, from);
} catch (NullPointerException e) {
LogInfo.log("fornia", "NullPointerException e:" + e.getMessage() + "|" + e.toString());
ToastUtils.showToast(getString(2131100833));
} catch (Exception e2) {
ToastUtils.showToast("三方传入参数未知错误,停止分享!");
LogInfo.log("fornia", "Exception e:" + e2.getMessage() + "|" + e2.toString());
}
}
}
示例6: initLite
import android.content.Intent; //导入方法依赖的package包/类
public static void initLite(Context context, Intent intent) {
if (intent != null) {
String scheme = intent.getScheme();
Uri data = intent.getData();
if (scheme != null && LITESCHEME.equalsIgnoreCase(scheme) && data != null) {
String albumId = data.getQueryParameter("aid");
String videoId = data.getQueryParameter("vid");
String packageName = data.getQueryParameter("packageName");
String jsonData = intent.getStringExtra("jsonData");
String lMode = data.getQueryParameter("launchMode");
int aid = 0;
int vid = 0;
int launchMode = 0;
if (!TextUtils.isEmpty(albumId)) {
aid = Integer.parseInt(albumId);
}
if (!TextUtils.isEmpty(videoId)) {
vid = Integer.parseInt(videoId);
}
if (!TextUtils.isEmpty(lMode)) {
launchMode = Integer.parseInt(lMode);
}
intent.putExtra("packageName", packageName);
if (launchMode == 2) {
intent.putExtra("launchMode", launchMode);
intent.putExtra("aid", aid);
intent.putExtra("vid", vid);
} else if (launchMode == 30) {
intent.putExtra("launchMode", launchMode);
intent.putExtra("jsonData", jsonData);
} else if (context instanceof Activity) {
Activity activity = (Activity) context;
if (activity != null) {
activity.finish();
}
}
}
}
}
示例7: initLite
import android.content.Intent; //导入方法依赖的package包/类
private void initLite(final Intent intent, boolean isCreate) {
String scheme = intent.getScheme();
if (!TextUtils.isEmpty(scheme) && AlbumLaunchUtils.LITESCHEME.equalsIgnoreCase(scheme)) {
this.isLitePlayer = true;
AlbumLaunchUtils.initLite(this, intent);
ApkManager.getInstance().setLiteAppCallState(true);
if (ApkManager.getInstance().getPluginInstallState("com.letv.android.lite") != 1) {
UIsUtils.setScreenLandscape(this);
if (isCreate) {
setContentView(2130903057);
}
LetvApplication.getInstance().mCallLiteIntent = intent;
JarUtil.updatePlugin(this, 1, true);
} else if (LetvApplication.getInstance().mIsPluginInitedSuccess) {
JarLaunchUtils.launchLitePlayerDefault(this, intent);
} else {
PluginInitedCallback.mPluginInitedListener = new OnPluginInitedListener(this) {
final /* synthetic */ LitePlayerStartActivity this$0;
public void onInited() {
JarLaunchUtils.launchLitePlayerDefault(this.this$0.mContext, intent);
}
};
}
} else if (isCreate) {
setContentView(2130903068);
}
}
示例8: animEndProcess
import android.content.Intent; //导入方法依赖的package包/类
private void animEndProcess() {
this.mMainShow = true;
getWindow().clearFlags(1024);
if (VERSION.SDK_INT >= 19) {
getWindow().addFlags(67108864);
}
LogInfo.log("bootPic", "animate end");
this.contentView.setVisibility(0);
getWindow().setBackgroundDrawableResource(2131493324);
this.animationIsFinish = true;
this.imageLayout.setVisibility(8);
Intent intent = getIntent();
Uri data = intent.getData();
if (data != null) {
String scheme = intent.getScheme();
if (scheme != null && SearchMainActivity.LESO_FROM.equalsIgnoreCase(scheme)) {
if (!isFromThirdParty(data.getQueryParameter("from"))) {
return;
}
return;
}
}
if (!this.initTashIsSuccess || this.mIsFromPush || this.mLaunchByPush || this.mIsForceLaunch) {
getHomeFragment().setHomeRecordVisible(true);
} else {
initPopDialog();
}
this.isAnimationIsFinish = true;
}
示例9: initSchemeParams
import android.content.Intent; //导入方法依赖的package包/类
private void initSchemeParams() {
if (getIntent() != null) {
Intent intent = getIntent();
String scheme = intent.getScheme();
if (!TextUtils.isEmpty(scheme) && "letvclient".equalsIgnoreCase(scheme)) {
Uri data = intent.getData();
if (data != null && data.getHost().equalsIgnoreCase(SCHEME_HOST_VIP_ORDER_DETAIL)) {
PaySucceedActivity.launch(this, PreferencesManager.getInstance().getAlipayAutoProductName(), PreferencesManager.getInstance().getAlipayAutoProductExpire(), PreferencesManager.getInstance().getAlipayAutoProductPrice(), PreferencesManager.getInstance().getAlipayAutoProductPayType(), mCorderId, true);
}
}
}
}
示例10: whichShare
import android.content.Intent; //导入方法依赖的package包/类
public static String whichShare(Intent realIntent){
final String a; //temp
final ComponentName b; //temp
final String c; //temp
if ((a = realIntent.getScheme()) != null) { //使用||的话会莫名其妙的空指针,改成遍历数组
for(String each: TargetIntentSchemes) { //遍历数组
if (each.equals(a)) {
return each;
}
}
}
else if((b = realIntent.getComponent()) != null){ //新微信
final String packageName = b.getPackageName();
final String className = b.getClassName(); //debug用的土方法
if ("com.tencent.mm".equals(packageName) && "com.tencent.mm.plugin.base.stub.WXEntryActivity".equals(className)
&& realIntent.getIntExtra("_wxapi_command_type",0) == 2 //命令1是调用微信登录,只有命令2是分享到微博
)
return "weixin";
}
/*else if((c = realIntent.getAction()) != null){
if("com.sina.weibo.sdk.action.ACTION_WEIBO_ACTIVITY".equals(c))
return "weibo";
}*/
return null; //不是分享
}
示例11: queryIntentFromList
import android.content.Intent; //导入方法依赖的package包/类
public List<R> queryIntentFromList(Intent intent, String resolvedType, boolean defaultOnly,
ArrayList<F[]> listCut, int userId) {
ArrayList<R> resultList = new ArrayList<R>();
FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
final String scheme = intent.getScheme();
int N = listCut.size();
for (int i = 0; i < N; ++i) {
buildResolveList(intent, categories, defaultOnly, resolvedType, scheme, listCut.get(i), resultList, userId);
}
sortResults(resultList);
return resultList;
}
示例12: queryIntentFromList
import android.content.Intent; //导入方法依赖的package包/类
public List<R> queryIntentFromList(Intent intent, String resolvedType, boolean defaultOnly,
ArrayList<F[]> listCut) {
ArrayList<R> resultList = new ArrayList<R>();
final boolean debug = localLOGV || ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);
FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
final String scheme = intent.getScheme();
int N = listCut.size();
for (int i = 0; i < N; ++i) {
buildResolveList(intent, categories, debug, defaultOnly, resolvedType, scheme, listCut.get(i), resultList);
}
sortResults(resultList);
return resultList;
}
示例13: queryIntent
import android.content.Intent; //导入方法依赖的package包/类
public List<R> queryIntent(Intent intent, String resolvedType, boolean defaultOnly) {
String scheme = intent.getScheme();
ArrayList<R> finalList = new ArrayList<R>();
final boolean debug = localLOGV ||
((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);
F[] firstTypeCut = null;
F[] secondTypeCut = null;
F[] thirdTypeCut = null;
F[] schemeCut = null;
// If the intent includes a MIME type, then we want to collect all of
// the filters that match that MIME type.
if (resolvedType != null) {
int slashpos = resolvedType.indexOf('/');
if (slashpos > 0) {
final String baseType = resolvedType.substring(0, slashpos);
if (!baseType.equals("*")) {
if (resolvedType.length() != slashpos+2
|| resolvedType.charAt(slashpos+1) != '*') {
// Not a wild card, so we can just look for all filters that
// completely match or wildcards whose base type matches.
firstTypeCut = mTypeToFilter.get(resolvedType);
secondTypeCut = mWildTypeToFilter.get(baseType);
} else {
// We can match anything with our base type.
firstTypeCut = mBaseTypeToFilter.get(baseType);
secondTypeCut = mWildTypeToFilter.get(baseType);
}
// Any */* types always apply, but we only need to do this
// if the intent type was not already */*.
thirdTypeCut = mWildTypeToFilter.get("*");
} else if (intent.getAction() != null) {
// The intent specified any type ({@literal *}/*). This
// can be a whole heck of a lot of things, so as a first
// cut let's use the action instead.
firstTypeCut = mTypedActionToFilter.get(intent.getAction());
}
}
}
// If the intent includes a data URI, then we want to collect all of
// the filters that match its scheme (we will further refine matches
// on the authority and path by directly matching each resulting filter).
if (scheme != null) {
schemeCut = mSchemeToFilter.get(scheme);
}
// If the intent does not specify any data -- either a MIME type or
// a URI -- then we will only be looking for matches against empty
// data.
if (resolvedType == null && scheme == null && intent.getAction() != null) {
firstTypeCut = mActionToFilter.get(intent.getAction());
}
FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
if (firstTypeCut != null) {
buildResolveList(intent, categories, debug, defaultOnly,
resolvedType, scheme, firstTypeCut, finalList);
}
if (secondTypeCut != null) {
buildResolveList(intent, categories, debug, defaultOnly,
resolvedType, scheme, secondTypeCut, finalList);
}
if (thirdTypeCut != null) {
buildResolveList(intent, categories, debug, defaultOnly,
resolvedType, scheme, thirdTypeCut, finalList);
}
if (schemeCut != null) {
buildResolveList(intent, categories, debug, defaultOnly,
resolvedType, scheme, schemeCut, finalList);
}
sortResults(finalList);
return finalList;
}
示例14: getApplinkLogData
import android.content.Intent; //导入方法依赖的package包/类
private static Bundle getApplinkLogData(Context context, String eventName, Bundle appLinkData, Intent applinkIntent) {
Bundle logData = new Bundle();
ComponentName resolvedActivity = applinkIntent.resolveActivity(context.getPackageManager());
if (resolvedActivity != null) {
logData.putString("class", resolvedActivity.getShortClassName());
}
if (APP_LINK_NAVIGATE_OUT_EVENT_NAME.equals(eventName)) {
if (resolvedActivity != null) {
logData.putString("package", resolvedActivity.getPackageName());
}
if (applinkIntent.getData() != null) {
logData.putString("outputURL", applinkIntent.getData().toString());
}
if (applinkIntent.getScheme() != null) {
logData.putString("outputURLScheme", applinkIntent.getScheme());
}
} else if (APP_LINK_NAVIGATE_IN_EVENT_NAME.equals(eventName)) {
if (applinkIntent.getData() != null) {
logData.putString("inputURL", applinkIntent.getData().toString());
}
if (applinkIntent.getScheme() != null) {
logData.putString("inputURLScheme", applinkIntent.getScheme());
}
}
for (String key : appLinkData.keySet()) {
Object o = appLinkData.get(key);
String logValue;
if (o instanceof Bundle) {
for (String subKey : ((Bundle) o).keySet()) {
logValue = objectToJSONString(((Bundle) o).get(subKey));
if (key.equals("referer_app_link")) {
if (subKey.equalsIgnoreCase("url")) {
logData.putString("refererURL", logValue);
} else if (subKey.equalsIgnoreCase("app_name")) {
logData.putString("refererAppName", logValue);
} else if (subKey.equalsIgnoreCase("package")) {
logData.putString("sourceApplication", logValue);
}
}
logData.putString(key + "/" + subKey, logValue);
}
} else {
logValue = objectToJSONString(o);
if (key.equals("target_url")) {
Uri targetURI = Uri.parse(logValue);
logData.putString("targetURL", targetURI.toString());
logData.putString("targetURLHost", targetURI.getHost());
} else {
logData.putString(key, logValue);
}
}
}
return logData;
}
示例15: onApplyPermissionsSuccess
import android.content.Intent; //导入方法依赖的package包/类
protected void onApplyPermissionsSuccess() {
super.onApplyPermissionsSuccess();
init();
initFloatBall();
initDownloadConfig();
this.mMainFlow = new MainFlow(this, this);
this.mMainFlow.start();
this.mMainFlow.requestFindTask();
this.mMainFlow.requestLocationMessage();
initExitRetain();
MyMessageRequest.requestUnreadMessageCountTask(new MessageListener(this) {
final /* synthetic */ MainActivity this$0;
{
if (HotFix.PREVENT_VERIFY) {
System.out.println(VerifyLoad.class);
}
this.this$0 = this$0;
}
public void onMessageCount() {
this.this$0.setMineRedPointVisible(true);
this.this$0.mMineFragment.refreshNewMessageVisible(true);
}
});
Intent intent = getIntent();
Uri uri = intent.getData();
String action = getIntent().getAction();
if (uri != null) {
String scheme = intent.getScheme();
if (scheme == null || !SearchMainActivity.LESO_FROM.equalsIgnoreCase(scheme)) {
this.mIsEnterFromThirdParty = false;
initDispBegin();
} else {
this.mThirdPartyFrom = uri.getQueryParameter("from");
if (isFromThirdParty(this.mThirdPartyFrom)) {
boolean z;
if (THIRD_PARTY_LETV.equalsIgnoreCase(this.mThirdPartyFrom)) {
z = false;
} else {
z = true;
}
this.mIsEnterFromThirdParty = z;
animEndProcess();
statisticsLaunch(0, false);
} else {
this.mIsEnterFromThirdParty = false;
initDispBegin();
}
}
} else if ("DownloadCompeleReceiver".equals(action)) {
LogInfo.log("Emerson", "-----------------------DownloadCompeleReceiver");
animEndProcess();
LeMessageManager.getInstance().dispatchMessage(new LeMessage(1, new MyDownloadActivityConfig(this).create(0)));
getIntent().setData(null);
} else if (intent.getBooleanExtra("isLesoIntoHomePage", false)) {
this.mIsEnterFromThirdParty = false;
animEndProcess();
} else if (intent.getBooleanExtra(MainActivityConfig.IS_FACEBOOK_INTO_HOMEPAGE, false)) {
this.mIsEnterFromThirdParty = false;
animEndProcess();
} else {
initDispBegin();
}
UIs.createShortCut(this.mContext);
gotoChildPage(getIntent());
registerLogInOutReceiver();
registerHomeKeyEventReceiver();
parseIntentData(getIntent());
LeMessageManager.getInstance().dispatchMessage(new LeMessage(119));
PreferencesManager.getInstance().saveLatestLaunchTime();
PreferencesManager.getInstance().setShowCommentRedDot(true);
registerTokenLoseReceiver();
LeMessageManager.getInstance().dispatchMessage(this, new LeMessage(LeMessageIds.MSG_WEBVIEW_UPDATE));
if (this.mVIPFragment != null) {
Bundle mBundle = new Bundle();
mBundle.putSerializable("channel", UIControllerUtils.getVipChannel(this.mContext));
this.mVIPFragment.setArguments(mBundle);
}
}