android-imageview

How to get the Drawable name from imageview in android and get it's String name for comparing

爱⌒轻易说出口 提交于 2019-12-25 10:17:17
问题 I have two drawable apple and a how to get the drawable name in my code and compare that they starts with same alphabet Community edited question Questioner is actually seeking for 2 problems- at first he wants to get the drawable id from the imageview id. (thw drawable which is showing in the imageview) then he wants to get the drawable name from that obtained drawable id in step-1. 回答1: Updated answer For step-1 There is no direct way. You need to save the drawable id in the imageview's Tag

Forced Close after adding custom ImageView

房东的猫 提交于 2019-12-25 09:49:19
问题 I'm trying to add a custom ImageView to my main.xml , but if I start the program it closes with a forced close. XML : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background" > <test.testpkg.CustomImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout

Set an ImageView in a ViewHolder getting Uri List from another activity

老子叫甜甜 提交于 2019-12-25 08:46:18
问题 Okay the problem is that I am selecting multiple images and have to display all the selected images in another activity recycler view(Grid View). I got the Uri paths(Tried string as well) in the first activity. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { try { // When an Image is picked if (requestCode == SELECT_PICTURE_MULTIPLE && resultCode == RESULT_OK && null != data) { // Get the Image from data String[] filePathColumn = { MediaStore.Images

If I have an image 50dp wide/tall in xhdpi, what size do I make for mdpi?

て烟熏妆下的殇ゞ 提交于 2019-12-25 08:17:20
问题 I am working with a graphic designer at the moment who is trying to verify what sizes images I am currently using in my app so he can create new images in the right size for all resolution modes (designing the image at the smallest size and then scaling it for the other modes). In my app, I am emulating a device that is 720 x 1280: xhdpi , and on this device, an ImageView is set to size 50dp x 50 dp . Is it correct to say 50 dp xhdpi -> 25 dp mdpi? 100px? Or 50px? What exactly? What is the

skia decoder->decode returned false when download image and display in imageview

别来无恙 提交于 2019-12-25 07:46:29
问题 i have a php page which return image from php page in json format $result = mysql_query("SELECT image FROM image_table WHERE email_id = '$email'"); if (!empty($result)) { if (mysql_num_rows($result) > 0) { $result = mysql_fetch_array($result); $user = array(); $user["image"] = base64_encode($result["image"]); $response["success"] = 1; $response["image_table"] = array(); array_push($response["image_table"], $user); echo json_encode($response); } else { $response["success"] = 0; $response[

How to drag a imageview in android studio? [duplicate]

孤街浪徒 提交于 2019-12-25 07:37:33
问题 This question already has answers here : Android drag and drop issue not displaying (2 answers) Closed 3 years ago . I'm using this tutorial to create a imageview and drag it over the screen http://www.tutorialspoint.com/android/android_drag_and_drop.htm but when i drag the image in my emulator and i drop it disappears! how can i fix that? here is my layout file <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android

Animate ImageView

北战南征 提交于 2019-12-25 07:17:43
问题 Currently I'm developing a game. This is the details of my game: User should choose the correct image object. I want the images to accelerate from left to right. and when they reach the end, they should re-appear on the activity again. This is the screenshot of what I'm working on: I have 5 imageviews and they should accelerate. Do you have sample code for this type of animation? Any help is truly appreciated. Thanks in advance! EDIT: Tried doing this: <?xml version="1.0" encoding="utf-8"?>

Animate ImageView

空扰寡人 提交于 2019-12-25 07:16:05
问题 Currently I'm developing a game. This is the details of my game: User should choose the correct image object. I want the images to accelerate from left to right. and when they reach the end, they should re-appear on the activity again. This is the screenshot of what I'm working on: I have 5 imageviews and they should accelerate. Do you have sample code for this type of animation? Any help is truly appreciated. Thanks in advance! EDIT: Tried doing this: <?xml version="1.0" encoding="utf-8"?>

Setting programmatically the pixel size of a remote ImageVIew?

女生的网名这么多〃 提交于 2019-12-25 05:16:40
问题 Let's say that I have a layout that contains <ImageView android:id="@+id/my_id" android:layout_width="123px" android:layout_height="345px" android:padding="0dip" android:scaleType="fitXY" /> which is used in an AppWidget and is set via a RemoteViews. How can I programmatically set the width and height in pixels (overriding the 123 and 345 in the above xml)? (motivation: this image view shows a dynamic png file that is set at runtime via a file URL. If the layout_width and layout_height above

How to populate dynamically created imageview through urls asyncronously…In Android

旧城冷巷雨未停 提交于 2019-12-25 04:55:12
问题 I am using horizontal pager https://github.com/ysamlan/horizontalpager/blob/master/src/com/github/ysamlan/horizontalpager/HorizontalPager.java to make dynamic views,and making dynamic images in it.... And using fedor imageloader to pupulate imageviews from urls... https://github.com/thest1/LazyList/blob/master/src/com/fedorvlasov/lazylist/ImageLoader.java but i am getting that annoying stid image.... here is my code... Any help or suggestion will be highly appropriated Thanx in advance public