at Notification Use the setImageViewResource function of RemoteView to insert the album art image into the Notification. There is no problem, but it slows down little by little when a function of about 100 valleys(?) is called. There was no such problem when testing without the above function. Memory seems to be piling up, so what's the problem? The notificationManager.notify() function runs in the showNotify below.
Glide.with(MusicPlayService.this)
.load(ContentUris.withAppendedId(Constants.ARTWORK, CurrentPlayList.get().getList().get(CurrentPlayList.get().currentPosition).albumId))
.asBitmap()
.fallback(R.drawable.ic_launcher)
.error(R.drawable.ic_launcher)
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
remoteViews.setImageViewBitmap(R.id.icon, resource);
remoteSmallViews.setImageViewBitmap(R.id.icon, resource);
showNotify();
}
});
Thank you. It doesn't have much to do with Glide.
https://groups.google.com/forum/#!topic/android-developers/qQ4SV5wL7uM
The link above has been referenced.
There is no separate memory management part in RemoteView, so they want us to create a new RemoteView whenever the contents change, such as image invocation. It's been solved neatly.^
^
Glide seems to have memory leak.
https://github.com/bumptech/glide/issues/616
onDestory() {
Glide.get(this).clearMemory(); // call this method manual
}
It says that this will solve the problem in Activity running the code above.
578 Understanding How to Configure Google API Key
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
581 PHP ssh2_scp_send fails to send files as intended
611 GDB gets version error when attempting to debug with the Presense SDK (IDE)
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.