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
public void openFile(Context context, File f)
{
Intent intent = new Intent();
intent.ad开发者_如何转开发dFlags(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);
}
it's not exactly clear what you need, but if your app is crashing, have you checked "LogCat" under "DDMS"?
It will tell you exactly the stacktrace, which will help you understand why your application is crashing.
精彩评论