1)
Android Download Manager Android 2.3 .
Download Manger HTTP- . Download.
, , , .
getSystemService (String), DOWNLOAD_SERVICE.
, API, ACTION_NOTIFICATION_CLICKED, , .
2) Foreground
- , , , , , , . , "", , , .
, , . .
To request the launch of your service in the foreground, call startForeground (). This method takes two parameters: an integer that uniquely identifies the notification and the notification for the status bar.
For instance:
Notification notification = new Notification(R.drawable.icon, getText(R.string.ticker_text),
System.currentTimeMillis());
Intent notificationIntent = new Intent(this, ExampleActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notification.setLatestEventInfo(this, getText(R.string.notification_title),
getText(R.string.notification_message), pendingIntent);
startForeground(ONGOING_NOTIFICATION_ID, notification);
To remove a service from the foreground, call the stopForeground () function. This method takes a boolean value, indicating whether the status bar notification should also be deleted. This method does not stop the service. However, if you stop the service