In Android development, many functions play a great role in actual applications, such as the implementation of the Android progress bar. Here is an introduction to Android ring progress bar (Android default form). The specific content is as follows:
.xml
<LinearLayout xmlns:andro xmlns:tools="/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" > <Button android: android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Find the Network"/> </LinearLayout>
.java
package ; import ; import ; import ; import ; import ; import ; public class MainActivity extends Activity { private Button but=null; @Override protected void onCreate(Bundle savedInstanceState) { (savedInstanceState); setContentView(.activity_main); =(Button) (); (new OnClickListenerImp()); } public class OnClickListenerImp implements OnClickListener{ public void onClick(View v) { //Create our progress barfinal ProgressDialog proDia=new ProgressDialog(); ("Search the Internet"); ("Please wait"); (); //Anonymous internal classnew Thread(){ public void run(){ try{ (3000); } catch(Exception e){ } finally{ //To access the data in the anonymous internal class, the data must be final();//Hide dialog box} } }.start(); (); } } }
The above content is the relevant knowledge of the Android ring progress bar (Android default form) introduced to you by the editor. I hope it will be helpful to everyone!