1
嗨,我在下面的代碼中動態獲取SD卡中的文件,但它顯示強制關閉我的意圖是當我打開文件時,它必須顯示所有目錄和文件從我那裏讀取和寫入應該開始幫我解決這個問題如何從SD卡中動態讀寫文件
public void openFile(Context context, File f)
{
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.content.Intent.ACTION_VIEW);
String type = getMIMEType(f);
intent.setDataAndType(Uri.fromFile(f), type);
context.startActivity(intent);
}
如果應用程序強制關閉,它將有助於獲得附加正在生成的異常的logcat輸出的答案。 – 2011-05-26 10:09:09
嗨拉克斯曼,你想要讀取和寫入數據到SDcard的代碼? – 2011-05-26 10:11:52