Ⅰ 如何調用android的內置圖片
調用android的內置圖片的方法:
方法一
Java code
File file=new File("/sdcard/IMG/1.jpg");
Intent it =new Intent(Intent.ACTION_VIEW);
Uri mUri = Uri.parse("file://"+file.getPath());
it.setDataAndType(mUri, "image/*");
startActivity(it);
方法二
Java code
ComponentName componentName=new ComponentName("com.cooliris.media","com.cooliris.media.Gallery"); Intent intent=new Intent();
intent.setComponent(componentName);
File file=new File("/sdcard/IMG/1.jpg");
Uri mUri = Uri.parse("file://"+file.getPath());
intent.setData(mUri);
intent.setAction(Intent.ACTION_VIEW);
startActivity(intent);
Ⅱ Android studio中XML文件調用圖片,這樣有什麼問題格式嗎 還有就是Android
android:src="@" 你缺少了標識符號;肯定會報錯;
Ⅲ 安卓怎麼根據圖片路徑調用系統相冊查看這個圖片
//使用Intent
Intent intent = new Intent(Intent.ACTION_VIEW);
//Uri mUri = Uri.parse("file://" + picFile.getPath());Android3.0以後最好不要通過該方法,存在一些小Bug
intent.setDataAndType(Uri.fromFile(picFile), "image/*");
startActivity(intent);
Ⅳ android怎麼調用系統自帶的圖庫打開指定目錄的相冊
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, 1);
採納一下,謝謝
Ⅳ android項目掉用系統圖片、圖標。 怎麼把創建項目時的應用圖標調用出來。或者說那些圖標在哪裡。
如果你有Android的系統源碼,可以到如下目錄中去找Android系統所用的圖片文件.
framework部分的各種資源,包括圖標,drawable,字元串等等.Android系統多數的圖標都在這個目錄.
其中hdpi等後綴表示圖標的各種解析度,進去後一看便知.
frameworks/base/core/res/res/drawable-hdpi/
frameworks/base/core/res/res/drawable-mdpi/
frameworks/base/core/res/res/drawable-xdpi/
frameworks/base/core/res/res/...
SystemUI是系統的狀態欄和下拉通知欄,這里也有一部分圖標.
frameworks/base/packages/SystemUI/res/drawable-*
packages/apps存放各種系統應用,比如圖庫,設置,音樂播放器等.
在每個應用的res目錄下,也可以找到圖片資源.以圖庫為例:
packages/apps/Gallery2/res/drawable-*
Android系統中絕大多數圖片資源都在上面所提的三個地方.
SDK里是找不到圖標的,得到源碼中去找.