Tag: android gallery

`getExternalStorageDirectory()`问题 – Android

我正在编写一个Android应用程序,它需要一些图片,并希望将它们全部保存在与我的应用程序相关的唯一目录中。 此目录应该可以从标准库中访问,以便用户以后可以(当应用程序不一定运行时)检查拍摄的图片。 我的问题是,每个不同的手机供应商,具有不同的Android版本,具有不同的图库路径。作为一个例子: Environment.getExternalStorageDirectory() + Environment.DIRECTORY_PICTURES +”/myFolder” 将运行Samsung Galaxy Nexus运行android 4.1.1 ,并在Asus Transformer Pad运行android 4.0.3 ,但不在HTC Desire运行android 2.3.5 。 这将导致我的应用程序在尝试在指定路径中保存新目录时崩溃,如下所述: boolean success = false; myFolder = new File( Environment.getExternalStorageDirectory() + Environment.DIRECTORY_PICTURES + “/myFolder” ); if( myFolder.exists() ){ //do nothing }else{ success = dvaFolder.mkdir(); if( success ){ // Do something on success /* * folder has […]

如何将画廊意图中的“开放”改为“完成”?

我正在使用以下意图打开图库以选择多个图像和video: Intent intent = new Intent(); intent.setType(“image/* video/*”); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, “Select Images”), MULTIPLE_IMAGE_SELECT); 当画廊打开时,它看起来像 在顶部它说“开放”我想将其改为“完成”或“确定”,如何实现这一目标? 谢谢。

从galery中选择图像并在imageview中显示

对不起写,但我有一个大问题.. 我6个小时寻找结果但是..没有:( 我需要在手机中打开我的galery并选择在imageview上打开活动的一张图片..没有什么难…但我有代码和模拟器(genymotion)中的代码运行完美..但在真正的手机小米Mi4什么都没有。 打开galery选择项目,什么也没有。 我没有更多的手机:( 我尝试下载这个主题的一些例子,每一个都是一样的…当我选择项目应用程序什么都不做时,galery打开.. 请问你有类似的问题吗? 你有一些项目与galery选择图像和imageview显示? 如果是的话请分享你的代码并上传我的地方.apk试试,因为我…… :(:’( 我的朋友 apply plugin: ‘com.android.application’ android { compileSdkVersion 25 buildToolsVersion “24.0.2” defaultConfig { applicationId “paradox.galopshop” minSdkVersion 19 targetSdkVersion 25 versionCode 1 versionName “1.0” testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner” } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’ } } } dependencies { compile fileTree(dir: ‘libs’, include: [‘*.jar’]) androidTestCompile(‘com.android.support.test.espresso:espresso-core:2.2.2’, […]