You can run an AyncTask
, or multiple if you need one for each check, in your onCreate()
and show a ProgressDialog
while the data is being fetched then cancel it in onPostExecute()
and move on to the rest of the MainActivity
depending on the data that is downloaded. If you need help getting started with AsyncTask
you can see this SO answer on the basic structure.
If you use a ProgressDialog
then the app will still start but the users will see something and know that data is loading so they won't feel like it is freezing or taking too long to load (or at least they will know why it isn't loaded right away).
AsyncTask Docs
Edit after comment
For what you said you want in your comment you can do this easily with an Activity
that has a Dialog Theme
. This will give you the functionality you need (a couple Button
s and store the values) but it will look like a little popup. You can't use an actual Dialog
as they need an Activity
, the same with any menu
s, AFAIK. Just create your Activity
and make it the launcher and main
using the Intent-filter
s then also add the following line to that Activity
's tag in the manifest
android:theme="@android:style/Theme.Dialog"
This approach should give you what you need