I need to create intent from thread:
final Runnable installapps = new Runnable() {
public void run() {
String[] fnames = appsPath.list();
for (String curfile : fnames) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(path)),
"application/vnd.android.package-archive");
startActivity(intent);
}
}
};
I tried using runOnUiThread but it’s still cant be done (app crashed).
Thanks
Made it with a handler and StartActivityForResult(). It starts installation Intent, waits for any result (just closing of intent), and executes next one.
handler.sendEmptyMessage(0);