gallery

Listing thumbnails per bucket

丶灬走出姿态 提交于 2019-12-02 07:52:48
问题 I have 2 classes. First is meant for searching for all folders, I mean Bucket list name. Seconds class makes thumbnails. But I need to have thumbnails per bucket. So when I push on my folder it should shows me all photos in it (thumbnails). Can somebody help me with it? First class: public class ThumbnailAdapter extends BaseAdapter { // Context required for performing queries private final Context mContext; // Cursor for thumbnails private final Cursor cursor; private final int imgId; private

Listing thumbnails per bucket

此生再无相见时 提交于 2019-12-02 06:36:33
I have 2 classes. First is meant for searching for all folders, I mean Bucket list name. Seconds class makes thumbnails. But I need to have thumbnails per bucket. So when I push on my folder it should shows me all photos in it (thumbnails). Can somebody help me with it? First class: public class ThumbnailAdapter extends BaseAdapter { // Context required for performing queries private final Context mContext; // Cursor for thumbnails private final Cursor cursor; private final int imgId; private final int imgData; private final int count; public ThumbnailAdapter(Context c) { this.mContext = c; //

Definitive Fix for Android's bug of duplicating photo on gallery when using the internal camera

≯℡__Kan透↙ 提交于 2019-12-02 06:27:38
This is definitive fix for the Android's problem of duplicating a photo. Tested it on 2.3 (which has the bug), 4.x (which doesnt have the bug) and 5.x (which has the bug too). The problem is that the photo is saved in two formats: usually one is the timestamp.jpg, and the other one is the full_date_and_time.jpg; sometimes in the same folder, sometimes in different folders. For example, "1430910805600.jpg" and "2015-05-06 11.14.00.jpg". Worstly, one cannot be converted to the other. The fix uses code that i found in some questions here in StackOverflow, and also an improvement of my own. First,

swift can not save .m3u8 file to gallery

血红的双手。 提交于 2019-12-02 06:07:17
Im using this below method to download and save my video to gallery, with .mp4 it's work normally, but when change to .m3u8 it's always fail. func downloadVideoLinkAndCreateAsset(_ videoLink: String,_ fileName : String) { // use guard to make sure you have a valid url guard let videoURL = URL(string: videoLink) else { return } guard let documentsDirectoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else { return } let fileNameToSave = "CiviX_HistoryVideo_\(fileName)" // check if the file already exist at the destination folder if you don't want to download

解决ListView,GridView,Gallery的Adapter中的getView多次调...

我的未来我决定 提交于 2019-12-02 05:49:18
ListView,GridView,Gallery 这三个控件的加载自定义的内容的时候,你要加载三次,但是当你打印的时候,却发现他运行的不止三次,那时因为什么呢? 这是android机制中要计算高的时候出现的一些多次调用 具体的可以去网上查找 解决的方法就是 将控件的 android:layout_width="wrap_content" android:layout_height="wrap_content" 这连个属性给改为 android:layout_width="fill_parent" android:layout_height="fill_parent" 这样你可能会说那么我要给他指定高度呢? 很简单,不管你是要自适应呢,还是要给定标准的数据,只需要在控件的外面再添加一个parent即可 然后将 android:layout_width="wrap_content" android:layout_height="wrap_content" 或者是指定的参数给parent 即可! 特别是层层嵌套的话,更应该这么做了,要不然会出现卡屏的现象哦! 之前我做项目 <ListView> <GridView></GridView> </ListView> 使用的是 android:layout_width="wrap_content" android:layout_height=

Android - Launch Gallery Folder and Select Image

只谈情不闲聊 提交于 2019-12-02 05:37:48
问题 I am doing an app which requires the use of the gallery viewer. I am using a button to launch the gallery activity. By using this code: startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("content://media/external/images/media"))); It returns me all the images in the gallery from different photo albums, where I would only want to display the default camera album (is this possible?), and when I click on the image to view it, it is fine until I click on the back button, the back button goes

Android Newly Taken Photo from custom camera does not appear in gallery (media store)

亡梦爱人 提交于 2019-12-02 02:53:53
in my app, i initially load all the images from the gallery, i.e. (MediaStore.Images.Media.EXTERNAL_CONTENT_URI) user can take picture via my app, but i have a custom camera, i.e. i do not use default phone camera to take pictures, i have my own surface view, i deal with Camera object directly, and handle the camera picture. and i save this image in a custom folder. i want the newly taken picture to appear in my gallery once user returns to my app problem: the newly taken picture does not appear in the cursor i loaded with MediaStore.Images.Media.EXTERNAL_CONTENT_URI the problem is gone only

Android ACTION_VIEW Multiple Images

情到浓时终转凉″ 提交于 2019-12-01 22:10:03
I have between one and three photos I'd like my app to display. I won't know until runtime exactly how many photos are downloaded from the Internet. I can't figure out how to create an Intent to display the photos. Right now I'm caching them on the sdcard under a folder I create by doing something like (sans error checking): final File externalDirectory = Environment.getExternalStorageDirectory(); final String folder = externalDirectory.getAbsolutePath() + "/Android/data/" + packageName + "/files/"; This was explained in the Android Developer Reference . I can get one photo to display by doing

Android ACTION_VIEW Multiple Images

无人久伴 提交于 2019-12-01 21:54:33
问题 I have between one and three photos I'd like my app to display. I won't know until runtime exactly how many photos are downloaded from the Internet. I can't figure out how to create an Intent to display the photos. Right now I'm caching them on the sdcard under a folder I create by doing something like (sans error checking): final File externalDirectory = Environment.getExternalStorageDirectory(); final String folder = externalDirectory.getAbsolutePath() + "/Android/data/" + packageName + "

saving image picked from gallery for future use

泪湿孤枕 提交于 2019-12-01 21:33:45
Hey i have been looking for a while now. the following code picks the image from the android gallery and shows it in an imageView. but heres the thing, everytime the app is closed and restarted the has to be picked again. i would like to know how i can edit the following to save the image for good in the imageView. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) { Uri selectedImage = data.getData(); String[]