当前位置: 编程技术>移动开发
本页文章导读:
▪Bitmap获取资料路径并显示及获取图片属性 Bitmap获取文件路径并显示及获取图片属性
private ImageView mImageView;
private String filePath = "/mnt/sdcard/DCIM/Camera/abc.jpg";
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setConte.........
▪ 【转】在装置(sdcard)上获得apk文件的信息,安装或运行 【转】在设备(sdcard)上获得apk文件的信息,安装或运行
http://stackoverflow.com/questions/5661418/get-apk-file-icon-version-name
protected void runAppFromApkFileOnSdCard()
{
final PackageManager pm = this.getPa.........
▪ 拷贝 资料 拷贝 文件
http://blog.csdn.net/ta8210/article/details/2073817
......
[1]Bitmap获取资料路径并显示及获取图片属性
来源: 互联网 发布时间: 2014-02-18
Bitmap获取文件路径并显示及获取图片属性
private ImageView mImageView; private String filePath = "/mnt/sdcard/DCIM/Camera/abc.jpg"; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.bitmap); mImageView = (ImageView) findViewById(R.id.imageView1); File f = new File(filePath); if (f.exists()) { /* 产生Bitmap对象,并放入mImageView中 */ Bitmap bm = BitmapFactory.decodeFile(filePath); mImageView.setImageBitmap(bm); } else { toast("文件不存在"); } } public void toast(String str) { Toast.makeText(BitmapImage.this, str, Toast.LENGTH_LONG).show(); }
获取图片宽高
Bitmap myBmp = BitmapFactory.decodeResource (getResources(), R.drawable.baby); /*透过Bitmap对象的getHight与getWidth来取得图片宽高*/ int intHeight = myBmp.getHeight(); int intWidth = myBmp.getWidth();
[2] 【转】在装置(sdcard)上获得apk文件的信息,安装或运行
来源: 互联网 发布时间: 2014-02-18
【转】在设备(sdcard)上获得apk文件的信息,安装或运行
http://stackoverflow.com/questions/5661418/get-apk-file-icon-version-name
http://stackoverflow.com/questions/5661418/get-apk-file-icon-version-name
protected void runAppFromApkFileOnSdCard() { final PackageManager pm = this.getPackageManager(); PackageInfo packageInfo = pm.getPackageArchiveInfo(fullPath, 0); Toast.makeText(getApplicationContext(), packageInfo.packageName, Toast.LENGTH_LONG).show(); // Intent intent = pm.getLaunchIntentForPackage(packageInfo.packageName); // if( intent == null ){ // File file = new File(fullPath); // intent = new Intent(); // intent.setAction(Intent.ACTION_VIEW); // intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // intent.setDataAndType(Uri.fromFile(file), // "application/vnd.android.package-archive"); // } // startActivity(intent); }
[3] 拷贝 资料
来源: 互联网 发布时间: 2014-02-18
拷贝 文件
http://blog.csdn.net/ta8210/article/details/2073817
最新技术文章: