imageview

Add imageViews dynamically on Android

天涯浪子 提交于 2019-12-22 14:47:08
问题 I want display images from HTML, and I get image url source using Jsoup . But, a problem is that each post has a different number of pictures. So, I can't fix the number of ImageViews in xml layout. After I researched, I know that I can create ImageViews dynamically. So, I create ImageViews and insert them into Linearlayout . But, I can only see one picture which I inserted lastly. package kr.ac.mju.hanmaeum.activity.notice; import android.content.Intent; import android.media.Image; import

Setting Android CheckBox to a different image… and then back to the original images

余生长醉 提交于 2019-12-22 13:49:18
问题 I'm using the following (very common) code to change the checkbox image in my Android app. mCheck = (CheckBox) findViewById(R.id.chkMine); mCheck.setButtonDrawable(R.drawable.my_image); I see many people asking for that. But I never see the second part: How do I put BACK the original checkbox imagery, later in my code? I hesitate to try to design all my own images (checked, unchecked, ghosted-checked, ghosted-unchecked, etc) because I need the original images that would normally appear on

Custom Splash Screen - Android

南笙酒味 提交于 2019-12-22 10:48:13
问题 Currently my android application shows a black screen with a loading wheel as it processes the user's request i:e as it gets content from the server. I would like to modify this screen to include an icon (image) that fades in and out continuously instead of the loading wheel. Is there any possible way to do it? 回答1: Yes, you'll use an Alpha Animation See here and here and lastly here for a good tutorial on Animations with some nice code. In order to "chain" your animations so that one starts

How to save image path using Shared Preferences

你说的曾经没有我的故事 提交于 2019-12-22 10:48:13
问题 I have an activity that opens another activity to get a camera gallery pic. The picture comes back to my original activity and rest in an imageView. That's working fine. How do I save the image so when the user comes back later, or kills to app the image is still there. I know I am supposed the use Shared Preferences to get the image path and not save the image itself but I just don't know how do that. Activity A private ImageView im1; private String selectedImagePath; private static final

How to display external storage image in imageview

烈酒焚心 提交于 2019-12-22 10:27:47
问题 I want to display external storage image like: "storage/sdcard0/image.jpg" in my android application. can any one guide me how to achieve this? 回答1: If your image is in the root folder of sdcard then access it through Bitmap bmp = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory().toString + File.separator + "yourimage.jpg"); webImage.setImageBitmap(bmp); 回答2: Try this function: Bitmap bitmap = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory()+File.separator+

creating a scaled bitmap in onCreate() according to the Imageviews height and width

别说谁变了你拦得住时间么 提交于 2019-12-22 09:40:34
问题 Here is the problem im having, in the onCreate() i would like to initially set the imageview to the first image in the list of files but with the ImageViews width and height, when it flips back and forth it sets the image to the ImageViews dimentions no problem but in the onCreate() i get IllegalArgumentException width and height must be greater than 0. i tried to make the start method if as it wasnt happening in the onCreate(), idk, any help is greatly appreciated, thank you for your time

Image showing in Android Studio but not on phone

夙愿已清 提交于 2019-12-22 05:52:20
问题 As you can see below this is what Android Studio shows: However, when I run this app on my phone the List View shows with just a blank image (i.e - a space) above it where the "somewhere over the rainbow" should be. The List View is working fine. It consists of one image view and 2 text views. (This image view is working if it helps). If any of this is possibly interfering then I will post the code here, but I find that hard to believe. The one thing that I was unsure of was whether I could

how to half overlap imageview on another imageview in android

夙愿已清 提交于 2019-12-22 05:13:46
问题 how can I overlap images half on one another from layout XML file like this image. 回答1: Simply you can use RealtiveLayout and negative margins <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_landing" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/screen_background"> <ImageView android:background="@color/black" android:id="@+id/img_background" android

Android how do I zoom and scroll a bitmap which is created on the fly

烈酒焚心 提交于 2019-12-21 22:41:43
问题 In my application, i'm using the following code for holding a map which is downloaded from a server. <?xml version="1.0" encoding="utf-8"?> <ScrollView android:id="@+id/scrollView1" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_gravity="center" android:layout_weight="1.0"> <ImageView android:id="@+id/mapImageView" android:layout_height="wrap_content" android:layout_centerInParent="true" android:layout_width="wrap_content" android:scaleType="center"/> <

how to implement pinch zooming on a programmatically created Imageview in android? [duplicate]

随声附和 提交于 2019-12-21 21:54:37
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: android multitouch image zooming? how to implement pinch zooming on a Imageview, programmatically created in android ? 回答1: See this : http://vivin.net/2011/12/04/implementing-pinch-zoom-and-pandrag-in-an-android-view-on-the-canvas/ and How can I get zoom functionality for images? also see : http://androidtrainningcenter.blogspot.se/2012/04/pinching-zoom-in-android-image-view-or.html and : http://www