Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UI getting stuck when softkeyboard shown while mediaplayer playing?

I have a mediaplayer in my app with a seekbar and two text views at both the ends of seekbar which works as timer and I will be playing .wav files in this player. I also have an editext in the same activity which I need to edit while the playing is in process. My problem is, when the playing in progress and if am toching the edittext the softkeyboard is shown and the UI gets stuck, means seekbar updation and the timer updation gets stuck. Am updating it using a timertask using a handler. Can anyone help to figure it out whats this issue. Why the UI gets stuck when the softkeyboard is shown?

I tried many other ways to update mediaplayer guessing it will be the problem of Using timertask.

  • Playing mediaplyer using service and updating it to UI using an handler.
  • Using only the thread and the handler by sending progress as message.
  • Using Assynctask and updating it in runOnUIthread.

In all thse cases when softkeyboard is shown all other Textviews and seekbar updation is getting stuck. Please help me to get out of this issue. Am totaly stuck :-(. Is there any other way to solve this problem.

like image 729
Sreedev Avatar asked Sep 05 '13 09:09

Sreedev


1 Answers

Mediaplayer UI is getting stuck because I was trying to update the UI using mediaplayers current position. So when Softkeyboard get shown and the UI is acessing mediaplayer simultaniously since mediplayer instance is heavy the UI was getting stuck. So I tried a different approch to update the UI using the percentage while playing, so that there is no need to acess mediaplayer currentposition. This problem was solved when I implemented this logic.

like image 137
Sreedev Avatar answered Sep 22 '22 23:09

Sreedev