Progressbar and Textview won't dissapear after finishing loading

i have a media player with a progressbars that show how much it has loaded but the progress bar and textview won't go away after finishing loading.

here is the code

EDIT - CODE WORKS NOW

private void initView() {
    Pbar = (ProgressBar)  findViewById(R.id.progressBar01);
    Pbar.setMax(100);
    txtview = (TextView)findViewById(R.id.textView01);
}


public void onBufferingUpdate(MediaPlayer mp, int percent) {            
             {
             if(percent < 100){
                 Pbar.setVisibility(View.VISIBLE);
                 txtview.setVisibility(View.VISIBLE);
             }
             Pbar.setProgress(percent);
             if(percent == 100) {
                 Pbar.setVisibility(View.INVISIBLE);
                 txtview.setVisibility(View.INVISIBLE);
             }
         }      
    }

Thx :P

Answers


Look for another listener you can use.

How about:

http://developer.android.com/reference/android/media/MediaPlayer.OnPreparedListener.html

I assume this will be called after it has done a buffer update.

public void onPrepared() {
      Pbar.setVisibility(View.INVISIBLE);
      txtview.setVisibility(View.INVISIBLE);
}

Need Your Help

Is there a way to start/restart/stop apache server on linux as non-root user?

linux apache

I'd like to know if it is possible for non-root user on linux (i'm using openSUSE) to run apache without using sudo command. Take into account that the user is in the same group as apache (wwwrun).

Facebook Status Retriever

facebook

Though I have been on Facebook for more than 2 years now, I'm a newbie to Facebook application developing. That field sparked an interest in me so I have been thinking of an idea to make a Facebook

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.