草庐IT

change-notification

全部标签

android - NotificationManager.cancel() 不起作用 : Notification isn't removed

我一直在尝试使用以下方法删除由服务设置的持久通知:startForeground(1337,notification);我用来取消它的代码:NotificationManagernManager=(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);nManager.cancel(1337);//cancelexistingservicenotification,doesn'ttakeeffectnManager.cancelAll();//surpluous,butalsodoesn't

android - 非法状态异常 : The content of the adapter has changed but ListView did not receive a notification

我正在使用自定义ArrayAdapter在AutocompleteTextView上设置适配器(AddressAdapter扩展ArrayAdapter)。publicclassAutoCompleteAdapterextendsArrayAdapterimplementsFilterable{privateArrayListmData;ArrayListlistTempPrefix=newArrayList();ArrayListlistTemp=newArrayList();StringvalueText;String[]words;Stringulcase;publicAutoC

android - 连接到 WiFi 接入点后未收到 WIFI_STATE_CHANGED_ACTION Intent ?

我的应用程序的部分功能是扫描并显示WiFi接入点列表,然后连接到用户选择的接入点。我有这个功能。现在,我还希望在连接“通过”时收到通知。这应该相当简单,但我发现自己绊倒了。我已经阅读了SO上的各种帖子,他们都提到了注册WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION或WifiManager.WIFI_STATE_CHANGED_ACTION。但是,这些都不适合我。任何人都可以发现这段代码中的任何错误吗?(我省略了进行扫描的部分)预期行为:一旦连接成功(即,当我在通知栏上看到“已连接”图标时),应该会收到广播并我应该看到toast。观察到的行

android - PagerTabStrip : change Tab Width

我想知道如何更改PagerTabStrip中的制表符宽度我浏览了,但是好像没有人遇到和我一样的问题..我目前的布局是这样的:但我想知道如何使用PageTabStrip创建宽度较小的选项卡他们中的大多数都使用外部库,如ViewPagerIndicator是否可以使用PageTabStrip来实现?谢谢这是我当前的代码 最佳答案 问题在这里回答:PagerTabStriptabsalignmenttoleftUsethisbeforesetViewPager():sliding_tabs.setDistributeEvenly(true

Android:如果将 Activity 带回屏幕,Notification 的 PendingIntent 不会触发 onCreate()

我猜我对IntentFlags有一些误解。我想做的是,我有一个radio流应用程序,它有两个Activity(PlayerApplication和SettingsScreen)。我有一个在后台运行的用于流媒体的Service.class,它也包含一个通知(您可以在通知覆盖菜单和PlayerApplication中停止/开始播放)。如果用户点击通知,PlayerApplicationActivity应该返回屏幕。一切正常,预期情况:用户打开SettingsScreenActivity->打开NotificationOverlayMenu->点击Notification->PendingI

Android - 如何使用代码允许/启用 "Floating notifications"设置作为 App 的默认设置

我想使用Android代码启用float通知。通常用户不知道该设置。所以我需要默认启用它。 最佳答案 恐怕是个坏消息。您可能知道,这需要权限SYSTEM_ALERT_WINDOW.由于AndroidM谷歌有begunlockingdown此权限可减少困惑。此权限的不同寻常之处在于它需要用户转到实际设置屏幕普通的AndroidM权限流程不适用于此。引用API:IftheapptargetsAPIlevel23orhigher,theappusermustexplicitlygrantthispermissiontotheappthro

widget - flutter : How to navigate to new page after state change?

状态改变后如何导航到新页面?我有一个需要先登录的应用程序。只有在登录后,应用程序组件才会完全创建。所以我写了这样的东西:主应用classAppComponentStateextendsStateimplementsCredentialProvider{Credentialcredential;@overrideWidgetbuild(BuildContextcontext){if(credential==null){returnnewMaterialApp(routes:{'/':(BuildContextcontext)=>newLoginPage(this),},);}else{r

widget - flutter : How to navigate to new page after state change?

状态改变后如何导航到新页面?我有一个需要先登录的应用程序。只有在登录后,应用程序组件才会完全创建。所以我写了这样的东西:主应用classAppComponentStateextendsStateimplementsCredentialProvider{Credentialcredential;@overrideWidgetbuild(BuildContextcontext){if(credential==null){returnnewMaterialApp(routes:{'/':(BuildContextcontext)=>newLoginPage(this),},);}else{r

Android Notification.PRIORITY_MAX 已弃用 在顶部显示通知的替代方法是什么?

如何在顶部显示安卓通知?setPriority(Notification.PRIORITY_MAX)由于Notification.PRIORITY_MAX已弃用,有什么替代方案?NotificationCompat.Builderbuilder=newNotificationCompat.Builder(context).setContentIntent(pendingIntent).setSmallIcon(R.mipmap.ic_launcher).setContentTitle("NotificationTitle").setContentText("NotificationTe

android - Android中是否有类似Apple Push Notification Service的推送通知服务?

我想为Android手机用户提供推送通知服务,Android中有没有类似ApplePushNotificationService的推送通知服务? 最佳答案 哦,是的!它叫做C2DM.请检查一下!编辑:Tutorial已添加链接!编辑:为了完整起见,C2DM现已弃用,取而代之的是GoogleCloudMessaging编辑:GCM现已被FirebaseCloudMessaging取代 关于android-Android中是否有类似ApplePushNotificationService的推