android-gallery

Embedding a Gallery into a ListView?

谁都会走 提交于 2019-12-25 08:57:38
问题 Can anybody tell me how to embed a Gallery into a ListVview , so that I can do horizontal scrolling over images inside ListView ? 回答1: Check this post, it worked for me. My setup is as follows: I have a ListActivity that uses an ArrayAdapter to populate it with data. My XML resource list_item contains an ImageView, TextView and a Gallery. I add an OnClickListener to the row (as you normally would to handle list item clicks.) Then I set the adapter for the Gallery I add a GestureListener to

Pick image from fragment always return resultcode 0 in some devices

╄→гoц情女王★ 提交于 2019-12-25 05:50:06
问题 I trying to pick an image from gallery and set the bitmap to my imageview, but I have a problem: in my device, works well, but it doesn't work in other. I start the image picker in my fragment as follow: Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("image/*"); startActivityForResult(photoPickerIntent, SELECT_PHOTO); And this is my onActivityResult : @Override public void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {

How to place a textview on Gallery in android?

烈酒焚心 提交于 2019-12-25 05:26:11
问题 In my application i have gallery view , i am displaying images from database in gallery,i need to place a text view on gallery item and change the text view value based on gallery position.So,how i can place text view on gallery.please can any one help me. Thanking in Advance. 回答1: Use custom adapter for you gallery view. Every item will contain an ImageView and also a TextView, for example in a RelativeLayout. Example here: Android gallery with caption 来源: https://stackoverflow.com/questions

Open android Gallery App from react native app

风格不统一 提交于 2019-12-24 20:12:18
问题 My application requires opening an image, stored locally in the document directories using the android gallery app.Is this possible in react native using linking. 回答1: So my requirement was to download an image on a button click an then open the same image using the android gallery , I achieved the same using react-native-fetch-blob which facilitates both downloading a file and opening it with the corresponding apps. P.S: you could also open the gallery using linking, provided you have the

Photo picker. Portrait turns to landscape

 ̄綄美尐妖づ 提交于 2019-12-24 00:22:49
问题 How to pick an image from gallery (SD Card) for my app? I have implemented the second answer (With the downsampling). When I select an image in portrait, the image will be shown in landscape mode.. Does anybody know why this is? And how to fix this? Thanks in advance! P.s. Sorry I've made a new topic out of this but the poster protected his topic against newbies like me :) 回答1: You have to get the exif rotation of the pic, like this and arrange youur bitmap accordingly public static int

Android how can i get thumb image of video file from gallery

那年仲夏 提交于 2019-12-23 18:12:25
问题 I need to show the selected video file from gallery in my listview. I have successfully fetched the uri of video file but i am not able to get the thumb image of video file. Here is the code i have used for fetching image of video file from uri, but is causes the app to crash. Is there any other way to get image of video file..? please assist me if it can be achieved in any other way.... public static String getFileMetaData(Context context,String uri){ Uri queryUri = Uri.parse(uri); // Get

onActivityResult doesn't call from viewPager fragment

家住魔仙堡 提交于 2019-12-23 10:09:11
问题 Hi I am using viewPager with fragmnets inside main fragment. I am trying to get image to bitmap from gallery or from camera, but after picking photo and startActivityForResult it doesn't catch in onActivityResult... here is how i call startActivityForResult: private void setAvatarDialog(){ final CharSequence[] options = {"Choose from Gallery", "Take Photo" }; String title = getString(R.string.alertDialog_editProfile_updateAvatar_title); String negative = getString(R.string.alertDialog

Intent Action_View for image opens gallery with no delete option

天涯浪子 提交于 2019-12-23 03:39:19
问题 In my app the user can capture images and I populate a grid layout to display thumbnails. On clicking the thumbnail I would like the user to see the full image and have an option of deleting it if they want to. This is the code for the onItemClickListener for the grid layout: layout_photos.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { final PhotoItem item = (PhotoItem) layout_photos

Get all captured Videos in Android as a list

99封情书 提交于 2019-12-23 01:55:25
问题 I am trying to get all video available in gallery with below code, String[] proj = { MediaStore.Video.Media._ID,MediaStore.Video.Media.DATA,MediaStore.Video.Media.DISPLAY_NAME,MediaStore.Video.Media.SIZE }; videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,proj, null,null, null); int count = videocursor.getCount(); But I always get count = 0 , where was I made mistake ? I also tried Cursor videocursor = managedQuery(MediaStore.Video.Media.INTERNAL_CONTENT_URI, proj, null,

Get all captured Videos in Android as a list

落花浮王杯 提交于 2019-12-23 01:55:07
问题 I am trying to get all video available in gallery with below code, String[] proj = { MediaStore.Video.Media._ID,MediaStore.Video.Media.DATA,MediaStore.Video.Media.DISPLAY_NAME,MediaStore.Video.Media.SIZE }; videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,proj, null,null, null); int count = videocursor.getCount(); But I always get count = 0 , where was I made mistake ? I also tried Cursor videocursor = managedQuery(MediaStore.Video.Media.INTERNAL_CONTENT_URI, proj, null,