Tell me, with the help of what can make such a progress bar.

enter image description here

    2 answers 2

    This is the standard ProgressDialog . Example:

     ProgressDialog progressDialog = new ProgressDialog(this); progressDialog.setMessage("Идет поиск рейсов"); progressDialog.show(); 

    To cancel:

     progressDialog.dismiss(); 

    You can hang around what you need:

     .setCancelable(false); //не закрывается по тапу вокруг .setTitle("Title"); //Заголовок 

    And much more, in detail in the official documentation.

      AsyncTask c progressdialog

      Example:

       private class NetCheck extends AsyncTask<String,String,Boolean>{ private ProgressDialog nDialog; @Override protected void onPreExecute(){ super.onPreExecute(); Context context = getApplicationContext(); nDialog = new ProgressDialog(Activity.this); nDialog.setTitle(""); nDialog.setMessage(""); nDialog.setIndeterminate(false); nDialog.setCancelable(false); nDialog.show(); } @Override protected Boolean doInBackground(String... args){ ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm.getActiveNetworkInfo(); if (netInfo != null && netInfo.isConnected()) { try { URL url = new URL("https://www.google.ru/"); HttpURLConnection urlc = (HttpURLConnection) url.openConnection(); urlc.setConnectTimeout(3000); urlc.connect(); if(urlc.getResponseCode() == 200){ return true; } }catch(MalformedURLException e1){ e1.printStackTrace(); }catch(IOException e){ e.printStackTrace(); } } return false; } @Override protected void onPostExecute(Boolean th){ if(th == true){ nDialog.dismiss(); new Process().execute(); } else{ nDialog.dismiss(); Context context = getApplicationContext(); ErrorMsg.setText(""); } } }