Show dialog at application / activity startup

Is it possible to show a dialog when the application / activity starts?

+3
source share
4 answers

Of course, you can show the dialog, see the answer Display notifications in Activity.onCreate (..)

+2
source

You can take a look at AsynTask. Among others, there are three methods that can serve your requirement.

onPreExecute, onPostExetcute and doInBackground;

run the run dialog in onPreExecute reject the run dialog in onPostExetcute you connect to doInBackground.

Hope this serves your purpose.

+1
source

http://www.droidnova.com/how-to-create-a-splash-screen,561.html

It seems that information about this is lost - just google it.

0
source

try this way in post to render your database from the database. and the start dialog box, then close it. if you want to show horizontal incremental progress indication then in backgrond put this code that I have.

private class DownloadImageTask extends AsyncTask {

protected Bitmap doInBackground (String ... urls) {

          while (myProgress<length){
                 myProgress=myProgress+1;  
                 myProgressBar.setProgress(myProgress);

          }
           return decodeImage(urls[0]);
      }

      protected void onPostExecute(Bitmap result) {
          dialog.dismiss();
          imView.setImageBitmap(result);
      }           protected void onPreExecute() {
  // Things to be done while execution of long running operation is
           in progress. For example updating
             ProgessDialog dialog = ProgressDialog.show(BusinessCardActivity.this,
            "Loading.........", "Wait For Few Second", true);             }
  }
0
source

Source: https://habr.com/ru/post/1761290/


All Articles