Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WeakReference相关问题 #48

Open
neugaojin opened this issue Mar 31, 2017 · 2 comments
Open

WeakReference相关问题 #48

neugaojin opened this issue Mar 31, 2017 · 2 comments

Comments

@neugaojin
Copy link

您好:

  1. 我的毕设打算做一款音乐播放器,最近在学习您的代码,我想请问下在remote Service中返回的IBinder的实现类中,为什么要使用WeakReference呢,还有在MusicPlayer中使用的是WeakHashMap,是担心内存问题么?假如GC执行了一次,他们岂不是就被回收掉了?这块没太想明白。
  2. 还有播放音乐MusicPlayer.playAll()时, handler.postDelayed(playMusic, 70);这里使用了一个70毫秒的延迟,我尝试过不延迟,也可以正常播放,请问这里是为什么
    小弟愚昧,还望赐教!谢谢
@neugaojin neugaojin changed the title WeakReference相关文题 WeakReference相关问题 Mar 31, 2017
@aa112901
Copy link
Owner

aa112901 commented Apr 1, 2017 via email

@neugaojin
Copy link
Author

您觉得这里如果使用软引用的话合适吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants