how to read and write files dynamically from sdcard
<p>hi all i used below code dynamically get files from sdcard but it shows force close my intention is when i open the files it must show all directories and files from there i to read and write should be start  help me to solve this problem    </p>

<pre><code>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);
}
</code></pre>
