Thread downloadThread = new Thread () {
@ Override
public void run () {
int flagSong = download.downloadFile (songFile);
download.setUrl_path (urlLrc);
int flagLrc = download.downloadFile (lrcFile);
int flag = flagSong + flagLrc;
Notification notification;
if (flag == 2) {
notification = new Notification (android.R.id.icon2,
"Download", java.lang.System.currentTimeMillis ());
notification.setLatestEventInfo (RemoteMp3Activity.this,
"Download", "Download Complete", null);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.defaults = Notification.DEFAULT_SOUND;
} Else {
notification = new Notification (
android.R.drawable.arrow_up_float, "download",
java.lang.System.currentTimeMillis ());
Intent notificationIntent = new Intent (
RemoteMp3Activity.this, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity (
RemoteMp3Activity.this, 0, notificationIntent, 0);
notification.setLatestEventInfo (RemoteMp3Activity.this,
"Download", "Download Incomplete", pendingIntent);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.defaults = Notification.DEFAULT_SOUND;
}
manager.notify (SONG_DOWNLOAD, notification);
}
}; Code
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Error is this.

Reply:
And I have a lot of places such notification will be given. Is to use it up.
Reply:
What happens. Solving
Reply:
if (flag == 2) {empty inside contentIntent see log should be the reason
LZ is under 2.3 bar code set contentIntent it otherwise error of 4.0 can be empty
Reply:
Alright. I try.
No comments:
Post a Comment