开发者

Why this text view is not refreshing +android

开发者 https://www.devze.com 2023-03-24 06:39 出处:网络
i used following code to play a audio while letter is drawing on text view.( I don\'t want to put it in another thread to give time delay like i done here).

i used following code to play a audio while letter is drawing on text view.( I don't want to put it in another thread to give time delay like i done here). In my code word is drawing at a time after while loop exits.. Any soln? TIA

          while(i < names[position].length() ) {  

                    alphabets1=alphabets1+""+tempName.charAt(i);
                    letterPosition=findLetters(tempName.charAt(i));
                    if(mPlayVoice!=null)
               开发者_Go百科     {
                        while(mPlayVoice.isPlaying()){ 

                                     //wait until audio stops
                                    }
                        mPlayVoice.release();
                        mPlayVoice=null;


                    }
                    mPlayVoice = MediaPlayer.create(BirdsActivity.this, mAlphabetsSound[letterPosition]);

                    mPlayVoice.start();
                    txtFrontName.setText(alphabets1); // problems here 
                    txtFrontName.refreshDrawableState();


                    if(i >= names[position].length())
                        wordsDrawingCompleted=true;
                    else
                        wordsDrawingCompleted=false;

            i++;
            }


try the txtFrontName.invalidate(); after set the text

0

精彩评论

暂无评论...
验证码 换一张
取 消