android-notification-bar

How to create a notification with NotificationCompat.Builder?

◇◆丶佛笑我妖孽 提交于 2019-12-17 02:34:28
问题 I need to create a simple notification which will be shown in notification bar along with the sound and icon if possible? I also need it to be compatitible with Android 2.2, so i found that NotificationCompat.Builder works with all APIs above 4. If there's a better solution, feel free to mention it. 回答1: The NotificationCompat.Builder is the most easy way to create Notifications on all Android versions. You can even use features that are available with Android 4.1. If your app runs on devices

Notification Bar is grey after implementing Nav Drawer

雨燕双飞 提交于 2019-12-13 11:40:30
问题 I am trying to learn implementations of Navigation Drawer in Android. In one activity, i have made the Navigation Drawer come under the Status Bar(transparent) and over the App Bar and everything works fine.(left Screenshot) In another activity in the same App, i am trying to create Navigation Drawer that pulls up under the App Bar. But here, the status bar turns grey for some reason(whether nav drawer is open or closed)(Right Screenshot). Other than this, everything seems fine. Below is the

Create a notification Bar with Drawable

大城市里の小女人 提交于 2019-12-13 00:26:07
问题 I am trying to create a custom Notification bar using a Drawable Object, but it don´t receive Drawable in the parameter, only Bitmap . The Problem: I need to get the icon of another application to set in my Notification. I tried use the code below: getPackageManager().getApplicationIcon(packageName);//Return a Drawable Object //Problem Notification.Builder builder = new Notification.Builder(context); builder.setLargeIcon(Bitmap); //I don´t have this one, only a Drawable object. As you can see

Android: How to distinguish CLEAR all events from notification bar from user action

丶灬走出姿态 提交于 2019-12-12 10:41:55
问题 According to the specification, .setDeleteIntent(pendingIntent) is associated to both actions (CLEAR all events from notification bar and user action like swiping). My requirements are that when the user touches the notification that appears on the notification bar, he must be forwarded to the NotificationsList.class . This is done with my pendingInent: PendingIntent sendPendingIntent = PendingIntent.getActivity(context, reminderId, new Intent(context, NotificationsList.class), PendingIntent

Disable Android Notification Bar in Full Screen (in SGIII)

喜欢而已 提交于 2019-12-12 01:34:53
问题 In Samsung Galaxy S3, even though my app is set to be full screen, and this makes the notification bar not to be visible, if I swipe from the very edge of the screen side, this action will make the notification bar to appear again, allowing the user to expand it over the full screen app. Is there any way to disable this, or to cancel the expand of the notification bar? The problem is that I have a listview covering the whole screen, and if I swipe to scroll the items, every time I do it from

Clear a Status Notification Android

大兔子大兔子 提交于 2019-12-11 23:09:33
问题 Im having difficulty clearing a status bar Notification. public void NotificationStatus(){ Intent intent = new Intent(this, Stimulation.class); NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); Notification notification = new Notification( david.flanagan.android.VenAssist.Activities.R.drawable.notification_icon, "VenAssist Stimulation ON", System.currentTimeMillis()); PendingIntent activity = PendingIntent.getActivity(this, 0, intent, 0);

Android Notification - How to bring the activity to front without recall the activity

梦想与她 提交于 2019-12-11 19:15:32
问题 In my app, in an activity(AndroidNotification.java) i am doing the following: 1) i am showing a notification when user press home button. 2) when user click the notification i show the app with the activity - AndroidNotification.java 3) i close the notification on notification bar when my app comes to front(that is in onResume method) The below code working but the problem is the notification call the activity(AndroidNotification.java) again my question is i do not want to relaunch the

Is there any way to remove notification/status bar, but not in onCreate?

独自空忆成欢 提交于 2019-12-11 16:46:43
问题 As far as I know, it is possible to hide the notification/title bar, once the activity is visible (has content) , But... maybe I'm wrong? Is there any way to hide it after the activity is visible? 回答1: You can define the activity to use a theme that eliminates the notification/title bar. For instance, you can add this as an attribute to your <activity ... > tag in AndroidManifest.xml: android:theme="@android:style/Theme.NoTitleBar.Fullscreen" The presence of a title cannot be changed once you

How to set sound for notification?

邮差的信 提交于 2019-12-11 14:38:19
问题 I copied the .mp3 file in assets. When notification raises, file is not playing Could anyone please help me. notification.sound = Uri.parse("file:///android_assets/alarm_951.mp3"); 回答1: try the following: notifyDetails.flags = Notification.FLAG_ONLY_ALERT_ONCE | Notification.FLAG_SHOW_LIGHTS | Notification.FLAG_AUTO_CANCEL; 回答2: Instead of copying your file to the assets folder copy it to resources/raw/ and then use Uri sound = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw

How to set Progress Bar and Progress Notification Bar for an Image Upload?

余生长醉 提交于 2019-12-11 11:44:00
问题 In my app,I am uploading a picture to a web Server ,So I want to display a Progress bar and Notification Progress Bar on notification drawer ,I have tried some methods,But the progress dialogue and Notification Bar shows different upload Percentage,I don't know, how to fix this issue.Any help is appreciated.Can anyone Help?? Method for Progress Bar. In this method I am calling the method to invoke Progress bar on Notification drawer.,and I am executing my AsyncTask task here.