0
我想通過android設備上安裝的本機應用程序打開遠程pdf文件。那可能嗎 ? 我試圖使用MIME類型的意圖,但不起作用。我不想使用docs.google.com參考。可能通過原生android應用程序打開遠程pdf文件?
有什麼建議嗎?
對於ref。 :
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(<remote_path>));
intent.setType("application/pdf");
PackageManager pm = getPackageManager();
List<ResolveInfo> activities = pm.queryIntentActivities(intent, 0);
if (activities.size() > 0) {
startActivity(intent);
}
和
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(<remote_pdf>), "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
爲您嘗試的內容發佈一些代碼。 –