progress bar - How to hide and show the Progressbar in android? -
i have written code load progressbar , have button click make invisible. click listener not working when clicking button.my app shows anr.
this code: layout:
<progressbar style="?android:attr/progressbarstylelarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centervertical="true" android:layout_alignleft="@+id/textview6" android:layout_alignstart="@+id/textview6" android:id="@+id/progressbar2" /> <button xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/button_send" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="stop progressbar" android:onclick="stoppb" />
and java file;
public void stoppb(bundle view) { super.oncreate(view); setcontentview(r.layout.content_main); progressbar pb = (progressbar) findviewbyid(r.id.progressbar2); pb.setvisibility(view.gone); }
i started android yesterday , i'm 14 years old... please me. tnx!
do :
public void stoppb(view view) { progressbar pb = (progressbar) findviewbyid(r.id.progressbar2); pb.setvisibility(view.gone); }
Comments
Post a Comment