当前位置:首页 » 安卓系统 » android打开图库

android打开图库

发布时间: 2022-05-11 06:07:08

㈠ 安卓图库不显示图片,怎么办

如果安卓图库不显示图片,你可以进行下列步骤进行查看:
1.打开手机的图库,可以看见图库不显示任何图片,提示没有图片/视频,只有一个大大 的相机图标。
2.进入文件管理-SD卡-images以及其他存放有图片的文件夹可以发现手机上的图片都没 有损坏,可正常显示。
3.使用手机数据线将手机和电脑连接,选择打开USB存储
4.勾选显示隐藏文件夹,找到一个叫做.nomedia的文件夹,删除部分第三方刷机包ROM 可能内置这个文件夹,以此来保护用户的隐私不显示在手机上。
5.关闭USB存储,拔掉数据线,打开手机-设置-应用-全部-图库-清除数据。
6.打开360手机安全卫士或LEB安全大师等第三方安全软件-自启管家-系统组件-图库如果 图库的状态是禁止自启,请取消图库的禁止自启状态,恢复图库的自启行为。
7.重启手机,图库的内容就可以正常显示了。(不重启手机也可以)

㈡ 安卓android手机 打开图片库 很多 有图片的文件夹!都会默认被预览!有些图片我不想被预览!怎么设置

android 是linux内核,在文件系统中以.开头的文件或者文件夹都是隐藏文件,因此你可以这样隐藏:

  1. 只需要将这个目录的名称改成.开头 即可隐藏掉。

  2. 图库默认有这个功能,只要你长按就会弹出选项,选择隐藏即可

安卓手机图片打开默认方式怎么改!

1、首先打开手机,打开设置软件,如下图所示。

㈣ 安卓手机怎么打开TIF格式的图片

可以使用mt管理器软件打开,具体的操作方法为:

1、在网络中搜索mt管理器,并下载安装。

㈤ Android 打开默认图库

开发的时候用Intent调用系统图库,不过如果手机装了多个图片浏览应用的话就会弹窗提示用户选择一个,这个时候要指定直接打开系统默认图库的话就要给Intent指定应用包,
Intent i = new Intent(
Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
i.setPackage("xxxx");// xxxx是具体报名,系统默认的一般是com.android.xx
startActivity(i);

// 同样的方式也适用与拍照,浏览网页等,包名具体自己查

㈥ android怎么调用系统自带的图库打开指定目录的相册

使用系统自带的图片浏览器应用程序Gallery可以打开一张指定的图片,
//使用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 gallery

Android原生内置了很多App,而Gallery为图库,用于操作设备上的图片,它会在开机的时候主动扫描设备上存储的图片,并可以使用Gallery操作它们。既然要使用Gallery,那么先看看它的AndroidManifest.xml清单文件。

<activity android:name="com.android.camera.ImageGallery"
android:label="@string/gallery_label"
android:configChanges="orientation|keyboardHidden"
android:icon="@drawable/ic_launcher_gallery">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/image" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/video" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.OPENABLE" />
<data android:mimeType="vnd.android.cursor.dir/image" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.OPENABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/image" />
</intent-filter>
</activity>
上面是Gallery的AndroidManifest.xml文件中的部分代码,展示了ImageGallery,从众多Intent-filter中可以看出,选取图片应该使用"android.intent.action.PICK",它有两个miniType,"image/*"是用来获取图片的、"video/*"是用来获取视频的。Android中众多Action的字符串其实被封装在Intent类中,android.intent.action.PICK也不例外,它是Intent.ACTION_PICK。

既然知道了启动Gallery的Action,那么再看看ImageGallery.java源码,找找其中选中图片后的返回值。

private void launchCropperOrFinish(IImage img) {
Bundle myExtras = getIntent().getExtras();

long size = MenuHelper.getImageFileSize(img);
if (size < 0) {
// Return if the image file is not available.
return;
}

if (size > mVideoSizeLimit) {
DialogInterface.OnClickListener buttonListener =
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
};
new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_info)
.setTitle(R.string.file_info_title)
.setMessage(R.string.video_exceed_mms_limit)
.setNeutralButton(R.string.details_ok, buttonListener)
.show();
return;
}

String cropValue = myExtras != null ? myExtras.getString("crop") : null;
if (cropValue != null) {
Bundle newExtras = new Bundle();
if (cropValue.equals("circle")) {
newExtras.putString("circleCrop", "true");
}

Intent cropIntent = new Intent();
cropIntent.setData(img.fullSizeImageUri());
cropIntent.setClass(this, CropImage.class);
cropIntent.putExtras(newExtras);

/* pass through any extras that were passed in */
cropIntent.putExtras(myExtras);
startActivityForResult(cropIntent, CROP_MSG);
} else {
Intent result = new Intent(null, img.fullSizeImageUri());
if (myExtras != null && myExtras.getBoolean("return-data")) {
// The size of a transaction should be below 100K.
Bitmap bitmap = img.fullSizeBitmap(
IImage.UNCONSTRAINED, 100 * 1024);
if (bitmap != null) {
result.putExtra("data", bitmap);
}
}
setResult(RESULT_OK, result);
finish();
}
}
以上的ImageGallery.java的部分源码,从setResult()方法可以看出,它返回的Intent包含了选中图片的Uri,它是一个content://开头的内容提供者,并且如果传递过去的Intent的Extra中,包含一个name为"return-data"并且值为true的时候,还会往Extra中写入name为"data"的图片缩略图。

㈧ android调用系统图库的问题

调用系统图库:
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"选择图片"), 2);

获取图片的内容:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Drawable d =null;
if (requestCode == 2) {
if (Activity.RESULT_OK == resultCode) {
Uri uri1 = data.getData();
Cursor cursor = this.getContentResolver().query(uri1, new String[]{"_data"},null, null, null);
if(cursor.moveToFirst()){
String otherfile = cursor.getString(0);
d=Drawable.createFromPath(otherfile );
}
}
}
}

㈨ android 图库刷新不了怎么办 手机内存卡里面新放进的图片,图库里面显示不出来,怀疑是刷新不了,怎么办

Android手机图库的图片不显示,刷新失败等错误,多数情况下都是图库或者相册这个应用由于某些原因导致出错了,导致无法预览,刷新。

以下是解决方法:

  1. 打开手机的图库,可以看见图库不显示任何图片,提示没有图片/视频,只有一个大大的相机图标

  2. 进入文件管理-SD卡-images以及其他存放有图片的文件夹可以发现手机上的图片都没有损坏,可正常显示

  3. 使用手机数据线将手机和电脑连接,选择打开USB存储

  4. 勾选显示隐藏文件夹,找到一个叫做.nomedia的文件夹,删除,部分第三方刷机包ROM可能内置这个文件夹,以此来保护用户的隐私不显示在手机上

  5. 关闭USB存储,拔掉数据线,打开手机-设置-应用-全部-图库-清除数据

  6. 打开第三方安全软件-自启管家-系统组件-图库,如果图库的状态是禁止自启,请取消图库的禁止自启状态,恢复图库的自启行为

  7. 重启手机,图库的内容就可以正常显示了

㈩ android 调用图库时怎样选择多张照片

步骤1:编写重定向到图片库的代码
我们需要写一些Java代码来处理按钮的点击事件,而重定向到图片库的代码如下:
Intent i = new Intent(
Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);

startActivityForResult(i, RESULT_LOAD_IMAGE);

注意:这里的RESULT_LOAD_IMAGE是一个整形常量需要传到startActivityForResult()方法。
步骤2:获取选中的图片
一旦选择了一张图片,onActivityResult()方法将会被调用。我们需要处理这个方法得到的数据,代码如下:

1 @Override
2 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
3 super.onActivityResult(requestCode, resultCode, data);
4
5 if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) {
6 Uri selectedImage = data.getData();
7 String[] filePathColumn = { MediaStore.Images.Media.DATA };
8
9 Cursor cursor = getContentResolver().query(selectedImage,
10 filePathColumn, null, null, null);
11 cursor.moveToFirst();
12 13 int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
14 String picturePath = cursor.getString(columnIndex);
15 cursor.close();
16 }

注意:onActivityResult()方法只有当图片被选中后才会调用。在这个方法中,我们需要检查requestCode是否是我们之前传给startActivityForResult()方法的RESULT_LOAD_IMAGE。

热点内容
表拒绝访问 发布:2025-05-15 22:29:37 浏览:976
电脑怎样解压文件 发布:2025-05-15 22:25:32 浏览:437
dns服务器怎么看 发布:2025-05-15 22:17:27 浏览:149
3dm的压缩包 发布:2025-05-15 22:09:23 浏览:661
和存储字长 发布:2025-05-15 21:54:09 浏览:514
用什么写c语言 发布:2025-05-15 21:35:56 浏览:418
linux读取u盘 发布:2025-05-15 21:32:13 浏览:508
c语言dos 发布:2025-05-15 21:18:17 浏览:664
sci编译英文 发布:2025-05-15 21:16:57 浏览:383
大猫如何设置密码 发布:2025-05-15 21:15:32 浏览:765