Android 实现在SD卡建立一个文件夹
2010-09-10 00:48:00 来源:WEB开发网核心提示:package com.wiseideal;import java.io.File;import android.app.Activity;import android.os.Bundle;import android.os.Environment;public class make extends Activity
package com.wiseideal;
import java.io.File;
import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
public class make extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
File sd=Environment.getExternalStorageDirectory();
String path=sd.getPath()+"/notes";
File file=new File(path);
if(!file.exists())
file.mkdir();
}
}
[]
更多精彩
赞助商链接