我使用Chrome標籤,查看從我的Android應用程序的網址,但我得到了一些崩潰,這個堆棧跟蹤CustomTabsIntent launchUrl拋出拋出:SecurityException - 權限拒絕
Fatal Exception: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=http://www.ikea.com/... cmp=com.alibaba.intl.android.apps.poseidon/com.alibaba.android.intl.weex.activity.WeexPageActivity (has extras) } from ProcessRecord{2fec948 29204:com.myapp/u0a71} (pid=29204, uid=10071) not exported from uid 10219
at android.os.Parcel.readException(Parcel.java:1620)
at android.os.Parcel.readException(Parcel.java:1573)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:3131)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1540)
at android.app.Activity.startActivityForResult(Activity.java:4283)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79)
at android.app.Activity.startActivity(Activity.java:4563)
at android.support.v4.content.ContextCompatJellybean.startActivity(ContextCompatJellybean.java:34)
at android.support.v4.content.ContextCompat.startActivity(ContextCompat.java:151)
at android.support.customtabs.CustomTabsIntent.launchUrl(CustomTabsIntent.java:262)
at com.myapp.chromeCustomTabs.CustomTabActivityHelper.openCustomTab(CustomTabActivityHelper.java:34)
at com.myapp.ProductSpecsActivity.goToStoreWebPage(ProductSpecsActivity.java:253)
at com.myapp.ProductSpecsActivity.goSeeDescription(ProductSpecsActivity.java:190)
at com.myapp.ProductSpecsActivity_ViewBinding$4.doClick(ProductSpecsActivity_ViewBinding.java:80)
at butterknife.internal.DebouncingOnClickListener.onClick(DebouncingOnClickListener.java:22)
at android.view.View.performClick(View.java:5697)
at android.widget.TextView.performClick(TextView.java:10826)
at android.view.View$PerformClick.run(View.java:22526)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7225)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
所以,任何人都可以幫助我弄清楚什麼是問題?順便說一句,它只發生在一些設備上,我無法在我自己的設備上進行測試時重現它。
,這裏是導致問題
public static void openCustomTab(Activity activity,
Uri uri) {
// create an intent builder
CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();
// Begin customizing
// set toolbar colors
intentBuilder.setToolbarColor(ContextCompat.getColor(activity, R.color.colorPrimary));
intentBuilder.setSecondaryToolbarColor(ContextCompat.getColor(activity, R.color.colorPrimaryDark));
// set start and exit animations
intentBuilder.setStartAnimations(activity, R.anim.slide_in_right, R.anim.slide_in_right);
intentBuilder.setExitAnimations(activity, android.R.anim.slide_in_left, android.R.anim.slide_out_right);
// build custom tabs intent
CustomTabsIntent customTabsIntent = intentBuilder.build();
// launch the url
customTabsIntent.launchUrl(activity, uri);
}
活動啓動CustomTab清單中
<activity
android:name=".ui.activities.productspecs.ProductSpecsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/title_activity_product_specs"
android:theme="@style/AppTheme.Base"
android:windowSoftInputMode="adjustResize" />
顯示一些代碼和你manifistist.xml。 – Ibrahim
請讓我看看完整的表現形式,幫助我來幫助你:) – Ibrahim
崩潰的設備是否安裝了鍍鉻物? –