Kind time of day I make an activit which in a separate thread checks the presence of a database and starts a certain activity depending on the existence of the database. Code:
package ru.systemtehnolodgi.stav; import android.app.Activity; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; public class LoadingPage extends Activity { LoadingPageTask lp_task; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.loading_page); lp_task = new LoadingPageTask(); lp_task.execute(); } Intent intent = new Intent(this, MainActivity.class); static final Uri TOOL_URI = Uri.parse("content://ru.htsprovider.htspdata/dataplasma"); Cursor cursor; class LoadingPageTask extends AsyncTask<String, Void, Void>{ @Override protected Void doInBackground(String... params) { cursor = getContentResolver().query(TOOL_URI, null, null, null, null); if(cursor.getCount() == 0){ } if(cursor.getCount() != 0){ //startActivity(intent); } return null; } } } Application falls. Do I understand correctly that you cannot run applications in the created stream? And how to organize a similar adventure?