I just want to add spinner (ring) progress bar for some time (5 seconds) in some specific view. After some time i want to disappear this progress bar.
Here is the class file source
verify_next=(Button)findViewById(R.id.button_add_friends_verify_account_button1);
progress_verify=(ProgressBar)findViewById(R.id.progressBar_verify_friends);
verify_next.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
verify_next.setVisibility(v.INVISIBLE);
progress_verify.setVisibility(v.VISIBLE);
}});
}
<ProgressBar
android:id="@+id/progressBar_verify_friends"
android:layout_width="120dp"
android:layout_height="40dp"
android:visibility="gone"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
/>
Now I want to set some time duration for this progress so that it should be disappear.
You can use a Handler for this
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
progress_verify.setVisibility(View.INVISIBLE);
}
}, 5000);