Я сделал код для экспорта Excel из Android намерения, но этот код не работает и показывает это предупреждение.
Intent intent = new Intent(Intent.ACTION_VIEW);
if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
Uri fileUri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".provider", dir);
intent.setDataAndType(fileUri,"application/*");
} else {
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setDataAndType(Uri.fromFile(dir),"application/*");
}
try {
context.startActivity(intent);
} catch (Exception ex) {
ex.printStackTrace();
Toast.makeText(context, "You need to have Microsoft Office Excel Installed here", Toast.LENGTH_LONG).show();
} finally {
Toast.makeText(context, "Success create report on " + dir.getPath() , Toast.LENGTH_LONG).show();
}