草庐IT

notification-channel

全部标签

Android 通知 channel - 从系统设置到应用程序设置的链接

我正在尝试遵循有关如何“将您的应用设置链接到Androidchannel设置”的MaterialDesign指南。如图所示,应用程序设置“应用程序中的其他设置”上应该有一个按钮,但我不知道如何设置它。https://material.io/guidelines/patterns/notifications.html#notifications-settings我希望NotificationChannel可以选择设置正确的Intent或Intent过滤器,但我找不到任何选项。managingthenetwork也有类似的行为我认为这会以同样的方式工作?!有人知道如何实现吗?

android - 尽管创建了 channel ,但通知未显示在 Android O 中

这是我在下面给出的代码。这无法在AndroidO上创建任何通知,尽管创建了通知channel。privatevoidweatherNotification(WeatherInfoweather){Intentintent=newIntent(this,WeatherActivity.class);PendingIntentpendingIntent=PendingIntent.getActivity(this,0,intent,0);StringtemperatureScale=prefs.getUnits().equals("metric")?getString(R.string.c

Android O 设置以启用应用程序的后台限制

根据Docs-Note:Bydefault,theserestrictionsonlyapplytoappsthattargetAndroid8.0(APIlevel26)orhigher.However,userscanenablemostoftheserestrictionsforanyappfromtheSettingsscreen,eveniftheapptargetsanAPIlevellowerthan26.我的目标是低于API26,但我找不到在官方android模拟器中启用限制的设置。此设置在哪里可用? 最佳答案 启用

android - Notification.bigContentView 在 API 24 (Nougat) 中被弃用,有什么替代方案?

我刚刚将编译sdk版本从API23升级到API24,似乎Notification.bigContentView已被弃用。那么问题是API24中用于在AndroidAPI24(Nougat)中设置bigContentView的等效方法是什么? 最佳答案 NotificationBuilderCompat有一个新方法setCustomBigContentView()在v4支持库24中。您可以使用此方法来避免弃用警告,并且该方法向后兼容。引用文档:从N开始,该字段可能为空。扩展的通知View由Notification.Builder的输入

android - 如何启动 Youtube 应用程序以打开 channel ?

我想从我的应用程序访问youtube以打开一个channel。我已经搜索了一个解决方案,但我只是找到了如何打开/流式传输视频:Intenti=newIntent(Intent.ACTION_VIEW,Uri.parse("vnd.youtube:VIDEO_ID"));startActivity(i);但是直接打开一个channel呢?非常感谢。 最佳答案 Intentintent=newIntent(Intent.ACTION_VIEW);intent.setData(Uri.parse(urlStr));startActivit

java - 对 youtube 应用配置文件/ channel 的 Intent

我可以通过YouTube应用轻松观看视频,但如何访问个人资料/channel?publicvoidYouTube(Stringid){//PlayYoutubeVideoIntenti=newIntent(Intent.ACTION_VIEW,Uri.parse("vnd.youtube:"+id));mContext.startActivity(i);}我..只是不知道从哪里开始?是否有特定的Uri来解析?我当然已经尝试过搜索互联网,但我正在寻找答案。甚至有可能吗?谢谢大家! 最佳答案 通过执行以下操作,可以启动YoutubeAp

android - 从 Android O Api 创建通知 channel 的正确方法

从AndroidO(API26)版本引入的通知channel。我从以下链接中了解了它:ManagingnotificationchannelsGoogleSampleforCreatingChannel问题:如果我有多个通知,那么在应用程序启动时创建通知channel并将其保存在ApplicationScope是个好主意吗?publicvoidaddNotificationChannels(Contextcontext){Listchannels=newArrayList();channels.add("channel_1");channels.add("channel_2");..c

java - 找不到符号 NOTIFICATION_SERVICE?

packagecom.test.app;importandroid.app.Notification;importandroid.app.NotificationManager;importandroid.app.PendingIntent;importandroid.content.BroadcastReceiver;importandroid.content.Context;importandroid.content.Intent;publicclassrunOnBootextendsBroadcastReceiver{@OverridepublicvoidonReceive(Co

PackagesNotFoundError: The following packages are not available from current channel

(diffusion-anomaly)root@I1124347ba900a0114b:/hy-tmp/diffusion-anomaly#condainstall--yes--filerequirements.txtCollectingpackagemetadata(current_repodata.json):doneSolvingenvironment:failedwithinitialfrozensolve.Retryingwithflexiblesolve.Collectingpackagemetadata(repodata.json):doneSolvingenvironment:

安卓 4 : can't dismiss notification by swiping

我有一些代码可以创建一些通知,它非常基础。inticon=R.drawable.notification;CharSequencetickerText="Text";longwhen=System.currentTimeMillis();Notificationnotification=newNotification(icon,tickerText,when);Contextcontext=getApplicationContext();CharSequencecontentTitle="Text";CharSequencecontentText="Text";Intentnotifi