我曾经使用SwipeToDismiss库,但现在我正在尝试迁移到RecyclerView,事情并不那么明显,你知道这个lib的替代品吗?任何想法如何从头开始实现它?
该应用程序具有活动以显示特定网站的内容,例如"example.com".因此,为了在app中显示"example.com/product/123"的内容,我有意图过滤:
<activity
android:name=".LinkInterceptorActivity">
<intent-filter android:priority="999">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.example.com"
android:scheme="http" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
但在某些情况下,我必须在浏览器中显示此内容,因此我决定使用chrome自定义选项卡,以使其更快,并将用户留在应用程序中.我尝试使用intent builder在自定义选项卡中显示url:
new CustomTabsIntent.Builder().build().launchUrl(activity, url);
但它向我显示了"使用...完成操作"对话框,其中我看到了我的应用程序和设备上的所有浏览器.如果我选择我的应用程序,它会跳转到循环并再次显示对话框,但如果我选择chrome它会按预期工作.
那么问题是如何为Chrome自定义标签创建显式Intent?
我将我的代码更新为API v26,设置了NotificationChannels,我可以看到我的通知,但我有关于禁用通知的逻辑.在26岁之前我有类似的东西:
NotificationManagerCompat.from(context).areNotificationsEnabled()
Run Code Online (Sandbox Code Playgroud)
这似乎现在没用.那么如何才能知道设置中是否禁用了通知通道?