imageview

Android - Button Question

I finally got my image button to work within an ImageView, and after I press it, it works, but imnmediately after, it stops running and I get the error message to close it. I added the onClick and focused it in the XML so that it will work within an imageview, but that's all I got. The button in the /drawable folder is the imagebutton se...

How to properly zoom a WebView together with it's background image?

I'm using the following code which only zooms the loadData. How is it possible to zoom the image inside? Thank you in advance! WebView web = (WebView) findViewById(R.id.myid); web.loadUrl("file:///android_asset/image.jpg"); web.getSettings().setBuiltInZoomControls(true); web.setBackgroundColor(0); web.setVisibility(ImageView.VISIBLE...

Display image from URL - sizing and screen orientation problems

I am trying to display an image from a URL, which may be larger than the screen dimensions. I have it kind of working, but I would like it to scale to fit the screen, and I also have problems when the screen orientation changes. The image is tiny, and I would like it to scale its width to the screen as well. (In both cases, I would li...

Android Linear/RelativeLayout sizing with ImageViews

Been stuck on this for days, things just aren't working with how I'm setting this up. I have a large grid of ImageViews which are all the same size. It's made up of a Horizontal LinearLayout and within that, 5 Vertical LinearLayouts (first picture). What I want (and I don't care how, be it using RelativeLayout, Linear or Tables) is if ...

clickable imageview location change with animation - android

I have an imageview that's included inside a RelativeLayout. When the imageview is clicked, I animate the entire RelativeLayout with a translate animation to move it down. when I click the imageview again (in it's new location) it's supposed to move it back up, but it does not. However, if I click where the imageview started, it does ...

Set Image on imageview

Hi all, i have 2 classes , say class A and Class B. in class A, i have one button,on that button click, i want set an image on class B's imageview. How can i set image on imageview of class B from class A? Regards ...

Android: can't remove vertical gap between images in LinearLayout

I have a simple LinearLayout in Android with two images vertically: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res/com.eataly.android" android:orientation="vertical" android:background="@android:color/white" androi...

[Android] ImageView object allways null

Hi, I have a very simple Android activity layout like this: <?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" > <ImageView id="@+id/blaimg" andro...

How can I create multiple context menus?

I have 1 activity, but would like to have multiple context menu's for different UI components. For example, I have a ListView which will react to: @Override public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle("...

My app gets "Force close" on several devices

I have people complaining my application gets FC when they launch it (meanwhile others never had a single problem). Here is my full activity source. Since it happens on devices I don't own I can not fix it. From what they tell me it doesn't work on: Motorola Blackflip, Motorola Dext, Motorola CLIQ XT. Guess Motorola doesn't like my app a...

how to set image view property in coding for android

<ImageView android:id="@+id/ImageView01" android:layout_gravity="center_horizontal" android:layout_marginTop="30dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="fitCenter" android:adjustViewBounds="true"> hi friends, i want to set this property in coding for image...

ANDROID: Possible to download imagview to phone or set an imagview as background?

I have an app that contains a picture gallery when one of the items in the gallery is pressed, the item clicked views as an imageview fullscreen. WHat I am then trying to do is allow the user to select whether to download the imageview to the phone or set it as a background...is this possible? How would I go about this? Thanks! ...

how to set image's top and bottom in same size for android?

I want to display image in center and top and bottom in same size refer bellow screens,anybody know please give the code to me... Thanks All ...

What is the most efficient way to load my stored JPG file into the ImageView?

I have valid JPG files and now I want to load them into a layout containing an ImageView. I have code to findViewId(R.id.myimage). I followed some sample code using File but it did not work. The file is stored at /data/data/com.myapp/files/someimage.jpg. What is the easiest and efficient way to load and display? ...

Set image from android.R.drawable in image view android

Hi, i know how to set image/icon from our res/drawable ImageView android:id="@+id/ImageSearch" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_green_3d"> If we set it directly from the code: imageView1.setImageResource(R.drawable.android_green_3d); But we can also get th...

Zooming an ImageView

This should be easy, but I'm having trouble figuring out how to zoom an ImageView. I have an ImageView inside of a ScrollView and a HorizontalScrollView. I floated a ZoomControls over the ImageView and now I'm trying to figure out how to actually zoom the image. I was thinking I would just scale the Drawable inside of the ImageView, but...

Custom ImageView with drop shadow

Okay, I've been reading and searching around, and am now banging my head against the wall trying to figure this out. Here's what I have so far: package com.pockdroid.sandbox; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import...

How to display an ImageView in a custom view in Android

I have an activity that calls a custom view when a button is pressed. The custom view runs fine until I try to add an ImageView to it. I have tried this in my xml that is called in my main activity with setContentView: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" andro...

How do i get the image name of a image in imageView?

Hi i want to upload the image to HTTP server, image upload is working fine but every time the image in the server is replaced with the new image. Can some one help me to implement the commented lines below. Thanks... - (IBAction)upload{ //NSString *imagename=imageview.image; //[self uploadImage:UIImageJPEGRepresentation(imagevi...

How do I move and Image View while program is running

So I have an ImageView sitting on a FrameLayout. I want to move this image view when user taps on it and drags it somewhere. This is what I tried to do: FrameLayout.LayoutParameters params = new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT); params.setMargin(marginLeft, marginTop, 0, 0); view.setLayoutParams(params); This does ...