protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
System.out.println(Environment.getDataDirectory().getAbsolutePath());
System.out.println(Environment.getRootDirectory().getAbsolutePath());
System.out.println(Environment.getDownloadCacheDirectory().getAbsolutePath());
System.out.println(Environment.getExternalStorageDirectory().getAbsolutePath());
}
//
/*
01-07 13:02:17.354 30959-30959/com.example.jacy.myapplication I/System.out: /data
01-07 13:02:17.354 30959-30959/com.example.jacy.myapplication I/System.out: /system
01-07 13:02:17.354 30959-30959/com.example.jacy.myapplication I/System.out: /data/cache
01-07 13:02:17.358 30959-30959/com.example.jacy.myapplication I/System.out: /storage/emulated/0
*/
Android获取相关目录
最新推荐文章于 2024-07-21 21:29:33 发布