I am doing following things
1- Using a button opening File Explorer to choose a specific file.
2- When file is selected it is copied to my app folder.
3- The Number of files attached to that user is increased by one.
Now i want to add this receipt in a small image view under the button. Suppose i run the application and added two images using button. Now a small view of these images should be displayed beneath the button. (I need to store these images in database too so i can use them whenever i want) Now as much as the images are, i need to display images beneath the button
How can i do that
Best Regards
Simply have a linearlayout in your xml, where you want to display image,
Get reference of LinearLayout in your activity by:
LinearLayout llContatiner=(LinearLayout)findViewById(R.id.llCOntainer);
when you have copied image, create an ImageView by:
ImageView imgView = new ImageView(mContext);
imgView.setBitmap(img);
// or imgView.setDrawable(img);
llContainer.addView(imgView);
Related
I have been trying to display multiple images with a image holder in a textview like in notes app but the solutions I have seen only support one image and the image view where just hidden and shows when you add images.
Example
enter image description here
It could be images, audio or links
I have taught of you creating multiple image view and hide and show them but I can't predict a user amount of image and that just inefficient
I am creating an android app which contains two activities:
The first activity display a default image. Clicking on the default image goto the second activity.
The second activity is an image gallery consist of images from the 'drawable folder in the android studio. Once the user clicks on an image, the user is brought back to the first activity with the selected image as the new profile picture.
Now I have issue when I try to get the image from the drawable folder. I have image's names in drawable folder as image1.jpg, image2.jpg, image3.jpg
How do I write the part of the code that brings these 3 image to create a gallery view for user to choose from?
I have a form where I capture a picture and show it in an imageview on android. Every time I clear the form and remove all views included in the imageview tag and try to recreate it, it doesn't show any picture. I'd like to know if there's a specific way to delete an imageview and create it again and keeps working fine.
I've tried to remove all views than every single view in the form but it still not working.
You can use imageView.setImageDrawable(null); to clear Image from ImageView and set new Image.
I have cardview list with each item containing image view and text. Each image for each item is provided as url with image to download.
Now, instead of converting each image to bitmap and putting it into my adapter I want to get functionality similar to Google Play search results, where images are refreshing after list is shown.
My idea is to use Universal Image Loader: https://github.com/nostra13/Android-Universal-Image-Loader so my images will be loaded in background.
However, I have no idea how to force refreshing only visible items. The rest should be refreshed on scroll, just after they appear when list is scrolled down. So basically, the same as it works in Google Playstore app.
Any tips?
I would like to create a gridview of images, in which, these images will be downloaded based on a web service response.
The thumbnails of images will be displayed in a gridview, similar to how iPhone displays photos.
User can tap on the image and the corresponding full-res image will be shown, sized to fit within the android phone. Upon tapping on the full-res image, it will minimize and return to the gridview.
So far, following the guide here, I had manage to create the gridview of images, but I would like to have it expand to the original size upon tapping and tapping again, return to the gridview.
See the Gallery, maybe all you need to do is change the OnItemClick behaviour.
http://developer.android.com/resources/tutorials/views/hello-gallery.html