android-notification-bar

Android: show notification bar on downloading application

℡╲_俬逩灬. 提交于 2019-11-28 00:35:48
I want to show a notification bar when an application is being downloaded in Android. I want the bar to be the same as the one showed when an application is downloaded from market. any help please? I think this link can help you: http://united-coders.com/nico-heid/show-progressbar-in-notification-area-like-google-does-when-downloading-from-android This is the download_progress (and to change the style of the progress bar, use your own android:progressDrawable ) <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height=

Set Drawable or Bitmap as icon In Notification in Android

陌路散爱 提交于 2019-11-27 22:51:20
I download a image from server as bitmap and convert it to drawable now i want to use this drawable as notification icon. But i am unable to do that. here is my code: Notification notification = new NotificationCompat.Builder(context) .setContentTitle(title) .setContentText(message) .setContentIntent(intent) .setSmallIcon(bitmap) .setWhen(when) .build(); but icon is a Resources int value so when i used it it gives error. Any help Edit: Now i update my code and now i am doing like that : Notification notification = new NotificationCompat.Builder(context) .setContentTitle(title) .setContentText

Android: How can I put my notification on top of notification area?

本秂侑毒 提交于 2019-11-27 20:56:51
问题 I'm trying to put my notification on top of notification area. A solution is to set the parameter "when" to my notification object with a future time like: notification.when = System.currentTimeMills()*2; The code that I'm using in this: long timeNotification = System.currentTimeMillis()*2; Notification notification = new Notification(statusIcon,c.getResources().getString(R.string.app_name),timeNotification); notification.flags = Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR;

non removable notification

我怕爱的太早我们不能终老 提交于 2019-11-27 20:09:08
In my app, there is service running on background. I want to notify user that the service is running. But I need that user cannot delete the notification - by pressing clear button or by swipe it out, in notification bar It means I need to show my notification above Notification area This is possible but the way you implement it depends on the API level you develop for. For API levels below 11, you can set Notification.FLAG_NO_CLEAR . This can be implemented like this: // Create notification Notification note = new Notification(R.drawable.your_icon, "Example notification", System

How to set the app icon as the notification icon in the notification drawer

泪湿孤枕 提交于 2019-11-27 19:46:28
As shown in the figure... I am getting my notification icon(on left to the red colour). But I need to display the app icon as shown by the black arrow public void notify(View view){ notification.setSmallIcon(R.drawable.ic_stat_name); notification.setTicker("Welcome to ****"); notification.setWhen(System.currentTimeMillis()); notification.setContentTitle("abcd"); notification.setContentText("abcd"); Intent intent = new Intent(this, home.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); notification.setContentIntent(pendingIntent

Click on the Notification programmatically

余生颓废 提交于 2019-11-27 09:22:17
I trying click on the notification after receiving it. I'm able to drag the notification drawer using the Accessibility service. For clicking the notification I'm using accessibilityEvent.getSource() and accessibilityNodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK); My code: public class MyAccessibilityService extends AccessibilityService { /** * On receiving the AccessibilityEvent performs the Actions * * @param event */ @Override public void onAccessibilityEvent(AccessibilityEvent event) { Log.i(TAG, "Get the Accessibility Event"); if (event.getEventType() == AccessibilityEvent

Notification passes old Intent Extras

老子叫甜甜 提交于 2019-11-27 06:31:04
i am creating a notification inside a BroadcastReceiver via this code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns); int icon = R.drawable.ic_stat_notification; CharSequence tickerText = "New Notification"; long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickerText, when); notification.defaults |= Notification.DEFAULT_VIBRATE; long[] vibrate = {0,100,200,200,200,200}; notification.vibrate = vibrate; notification.flags |= Notification.FLAG_AUTO_CANCEL;

How can I programmatically open/close notifications in Android?

喜欢而已 提交于 2019-11-27 06:27:56
I've searched everywhere, but can't find anything in the SDK or on Google on how to do this. I know it's possible because all the custom launchers are able to do it via a button press (LauncherPro, ADW, etc). Thanks. You can programmatically close the notification drawer by broadcasting an ACTION_CLOSE_SYSTEM_DIALOGS intent. This causes "temporary system dialogs" to be dismissed. From the documentation: Some examples of temporary system dialogs are the notification window-shade and the recent tasks dialog. This doesn't require any permissions, and has apparently been available since Android 1

Remove notification from notification bar from other applications

一世执手 提交于 2019-11-27 02:42:18
问题 I want to remove notifications from another application shown in the notification bar. Is that possible? NotificationManager.cancelAll(); cancels only notifications shown by the calling application, as far as I know. Why do I want to do this? I have an application that reads and sends SMS via a webpage, and I want this application to co-exits with existing SMS applications like Handcent SMS. The way I want it to work is that when reading newly received SMS via the webpage, I want to cancel

How to detect when the notification/system bar is opened

瘦欲@ 提交于 2019-11-27 02:18:01
I needed to know when the system/notification bar gets opened in my app, and I couldn't find any real solutions, so I hacked something together which seems to work pretty well. Before I big with the implementation, I will give a brief explanation of my (very hacky) logic. When an Activity is no longer visible to the user for any reason, onWindowFocusChanged(..) gets invoked. However, onStop() only gets invoked when the Activity is no longer visible to the user by going to the background. I noticed that when switching Activities, onStop() is always invoked after onWindowFocusChanged(..), so I