FAQ Database Discussion Community


Bitmap not circle properly

android,bitmap,imageview
i trying to do bitmap circle it work but high resolution image not work properly.It is working like small circle in image view. i have tried this code and i tried many other code,but didn't work properly public static Bitmap circleShape(Bitmap bitmap) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); Canvas...

Android - Send imageView to X Y position

android,imageview,translation
i have an imageView A that starts at right screen. I want to set X and Y position programatically. To move the imageView near the top left corner, i have to set a X = -1497 Y = 20. What i dont understand is why X = -1497. I think...

Repeat image horizontally and vertically

ios,imageview
I want to repeat the following image: to achieve the following background: I tried a few codes as follow: bluePatternView.backgroundColor = [UIColor colorWithPatternImage: [[UIImage imageNamed:@"blue_pattern.png"] stretchableImageWithLeftCapWidth:0 topCapHeight:0]]; and: bluePatternView.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"blue_pattern.png"]]; I also tried to draw image with CGContextDrawTiledImage with no success. How that can be done?!...

android change imageview programmatically

java,android,imageview
I am making an android app where the same imageview is displayed every time the user enters a value. but I want the imageview to be changed every time the user enters a value. I wrote a code to do this but the problem is after the first image is...

android:load image from sdcard with picasso

android,image,imageview,picasso
is it possible to use picasso library to load image from sdcard to imageView ?

Error with image view when displaying an image by camera capturing

java,android,camera,imageview
i am new to android and i am trying to make my phone cam take a picture and display it in an image view. When the image is captured, it is saved correctly but after that the app stops working when the image should be displayed in an image view....

Android: Replace -tag with ImageViews

android,html,image,replace,imageview
I'm showing a bit of HTML in a TextView using Html.fromHtml, which works great. Sometimes this html will have img-tags, and I'd also like to display these. I tried Android HTML ImageGetter as AsyncTask but this seemed slow and unpredictable (size of the image). Example HTML (it can differ...): <h2>title</h2><br...

Converting image url to bitmap quickly

android,bitmap,imageview,imageurl,imagehandler
I need to display the list of images from api in the list page. For that i used two approaches. First Approach: By converting the url to byte array and then converting it into bitmap.Please find the below code.. URL imageUrl = new URL(url); URLConnection ucon = imageUrl.openConnection(); InputStream is...

how can I resize gif with custom height and width in android?

android,imageview,gif,ion
I am using Koush/Ion library to load gif from internet into imageview but I cannot resize the gifs aspectly, upon calling resize function, gif becomes still so my question is, is there any way I can resize gif aspectly in android ? here's my calculation to get aspect height and...

Can't load an image from URL

android,listview,android-listview,imageview,android-imageview
I've tried to load an image from URLs but it's not working. Two different errors are happening. When I put an URL that starts with www the app doesn't close but neither load the image, only shows a white space. But when the URL start with http:// the app closes....

stretch image in imageview to fit screen in xml

android,xml,imageview
I have image in drawable, which needs to work as the background. It needs to stretch to fill the screen.. I know how to stretch the image full screen using java code.. but in XML itselt how can do this.

android imageloader and imageview scaletype

android,imageview,universal-image-loader
I have an imageview element into relativelayout with textView like this <RelativeLayout> <ImageView android:id="@+id/image" android:layout_width="fill_parent" android:layout_height="fill_parent" android:adjustViewBounds="true" android:background="@color/darkblue" android:scaleType="fitXY"/> <TextView android:id="@+id/title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignBottom="@+id/image" android:paddingBottom="2dp" android:gravity="bottom"...

Android - draw9patch should help me? background of textview

android,view,background,textview,imageview
I need to set background of the TextView without stretching like this: I tried draw9patch but seems that it doesn't do that work. How can I reach this efect? I could also use ImageView, but I don't know how I can add text in ImageView (I cannot use layout or...

Resizing an imageview's width/height greater or lesser upon a button click?

android,image,resize,imageview
Would this work for changing an imageview's size? Doing something such as: ImageView image = (ImageView) findViewById(R.id.image); relativeLayout.addView(image); ... Then upon button click have this happen: image.getLayoutParams().width = image.getLayoutParams().width - 10; I click my button but nothing seems to happen. Why? What's the correct way to go about manually resizing...

Assign an image resource to ImageView according to a flag

android,onclick,imageview,flags
I have to change the image dsiplayed in the ImageView, when user click on it. And when he clicks it again, I want to show the original image. How to do this with the flags? Supposably: imageView1, R.drawable.pic_one, R.drawable.pic_two. ...

ImageView size is not displayed correctly

android,gridview,bitmap,imageview,android-gridview
I'm having a problem of displaying ImageViews with the correct size. Almost all the posts that I've read through involves ImageViews that are created in the layout file. However in my case, I'm creating ImageViews programmatically. I'm trying to display all images from a particular folder located in the storage....

Starting a transition on specific time in Android?

android,imageview,transition
Hey guys I've made an transition for an imageview and I want to play it when the time in Android Phone is for example 10:00 AM, then how can I do this? I tried to do this with AlarmManager but it's of no use! It's not getting work done, is...

JavaFX: How can I horizontally center an ImageView inside a ScrollPane?

javafx,imageview,scrollpane
viewScroll.setContent(new ImageView(bigimg)); double w = viewScroll.getContent().getBoundsInLocal().getWidth(); double vw = viewScroll.getViewportBounds().getWidth(); viewScroll.getContent().setTranslateX((vw/2)-(w/2)); viewScroll.toFront(); I set an ImageView with some Image inside the ScrollPane but the ImageView always goes to the far left corner. Here I'm trying to manually offset the difference, but it doesn't work well. The ImageView goes too far...

Refresh QuickBadge/ ImageView on a Fragment after taking a picture

android,image,imageview,fragment,android-camera
I want to take a picture in my App, so if I click on my ImageView/QuickBagde on my Fragment. I'm able to take a picture, after that, I crop it and it return to my App. This is not a big deal and it's working well. But how can I...

How to Center ImageView in HorizontalScroll View Android

android,xml,imageview,horizontalscrollview
I have been trying to center a large wallpaper of 3000px x 1500px (roughly) to when loaded show the center of the image and then the user can scroll left or right to view the rest. I have looked at a few examples and it doesn't seem to help it...

Out of memory Exeption using Picasso

android,imageview,android-viewpager,out-of-memory,picasso
I need to show images in view pager. To show image in image view I use Picasso library. Also I resize image using screen size. So in my Activity in OnCreate I got view pager: mPager=(ViewPager)findViewById(R.id.pager); mPagerAdapter = new ScreenSlidePagerAdapter(); mPager.setAdapter(mPagerAdapter); Then get device size: Display display = getWindowManager().getDefaultDisplay(); Point...

What is the best way to change the source of an imageview? [closed]

android,imageview
I have one imageview which consist of one png file. I want to change the source of this imageview according to 4 different events (4 different pngs). Currently I'm changing the source with imageView.setImageResource, but this has lag and causes lots of Choreographer warnings. Are there better ways?

Android Studio - How do you get image from gallery and then save it

image,imageview,save
I have an app that contains a button. when you press the button, the application will send you to your mobile phone's image gallery. you then select the image and it will appear on an imageview above the button. This all goes without a problem but the only bad thing...

Is it possible to put ImageView on Canvas in JavaFX?

java,canvas,javafx,popup,imageview
I am a newbie to javafx. I am developing an application in which I have a canvas and I have drawn several images in it. I want to add an ImageView on my canvas and implement a popup while clicking on the ImageView? Is there any possibilities with or without...

Android Images in a gridView in wrong order

android,arrays,gridview,random,imageview
i have a problem with a image gridView. I put all the images in an array, but when the grid is displayed the images aren’t in the order that I decided. Here is my code taken from various tutorials. The main activity: <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:text="Clicca sull'immagine per ingrandire"...

Show imageview after click wait a moment then hide again [Android]

android,multithreading,imageview,show-hide
I'm trying to show some imageviews after the user has clicked on a button then wait for some time for the user to see which was the correct button to click then hide it again. Something like this: User clicks on button giving his answer -> Score is updated and...

How do i adjust ImageView if it falls outside of view Switcher bounds?

android,imageview,android-linearlayout,viewswitcher
i have view switcher(it contains 2 views of kettle - on and off) the first image is kettle "off" , and it stays outside of actual viewSwitcher. I tried fitXY, fixStart, fitCenter - did not help! Below is the layout of viewSwitcher I already tried to change the size...

How to create a history of pressing ImageButton

android,imageview,imagebutton
I am a novice developer. Please help to create the code to display the history of pressing ImageButton (on Android). I have three ImageButton (IB1, IB2, IB3) and I have 5 empty ImageView (IV1, IV2, IV3, IV4, IV5). When the user first time touching one of the three ImageButtons (for...

Display image gallery with ImageView

java,android,imageview
I want to do so: Press the button opens gallery, choose a picture and it appears in the program ImageView. Picture selected all works only displayed nothing, just an empty area. //upload photo uploadPhoto.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("image/*"); final int...

how to pass NetworkImageView(volley library) content to another actvity?

android,textview,imageview
I've two NetworkImageView elements in ListView, one is visible NetworkImageView element and another invisible NetworkImageView element. And I've implemented a onlickListener to Listview elements which calls a new activity whenever i select the element in the ListView. when calling a new activity i'm passing these two NetworkImageView elements to new...

Titanium android remote image not shown

android,image,imageview,titanium
I am using Titanium to build a cross-platform mobile application, which I mostly tested with the iOS simulator and where I already got all functionality working. Now I want to have the app also bugfree on Android. One of the issues I'm facing right now is that the remote images...

Import photo to imageview

ios,swift,upload,imageview
I need to do, that user can upload photos from a photo(from device) into imageView. Add an action button? How it works? ...

ImageView setOnClickListener in a dialog

android,dialog,imageview,onclicklistener
I create a custom dialog box with this method: public Dialog onCreateDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); LayoutInflater inflater = this.getLayoutInflater(); builder.setView(inflater.inflate(R.layout.dialog_rate, null)) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { SharedPreferences.Editor settingsEditor = settings.edit(); settingsEditor.putBoolean("rate",false); settingsEditor.apply(); Intent intent = new Intent();...

Make views visible one by one; android

android,imageview
I'm having trouble with making views visible. As in: they do all appear, but at the same time, whereas I would like to show them with some delay in between. Currently I have the following code, which should make it more clear: public void performExperiment (View v) { Log.i(TAG, "Experiment...

Image goes over border of listview when scrolling

android,listview,android-listview,scroll,imageview
I've created several items in a list view. Each item in the listview is comprised of a custom adapter with a two row table. I have images and texts in the rows of the adapter table. When I scroll the list view, the contents of each row go over the...

Setting ImageView after Crop not working

android,image,camera,imageview
I've created a basic activity with an imageView and two buttons. 1 Button opens the gallery, the other opens the camera. Both of which pass the result into a image cropping library. The cropped image is saved and shown in the imageView. The first I do this with either button,...

Add image to textview from an external/internal url [closed]

java,android,textview,imageview,picasso
I want to know how to add an image to an TextView from an internal and external URL. Say I have an URL https://www.example.com/img/img.jpg using picasso I can easily do Picasso.with(this).load(url).into(imageView); But how do I use it in case of TextView ?...

How to align an image-view for all android screens

android,imageview,alignment
I want to align an image view which is displayed same for all android screens expect for Android tab screen. Different alignment of imageview is noticed for imageview when app runs on emulator or live device. how do i align them properly?? Here is my activity.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"...

What is the use of decoding bitmapfactory twice?

android,imageview,bitmapfactory
I came across this on the developer's website on the Loading Large Bitmaps Efficiently tutorial. public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId, int reqWidth, int reqHeight) { // First decode with inJustDecodeBounds=true to check dimensions final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; **BitmapFactory.decodeResource(res, resId, options);** // Calculate inSampleSize...

ListView Custom Adapter that includes Images from galery

android,listview,android-listview,imageview,custom-adapter
When creating a custom ListView adapter, usually I extend it from Array Adapter<String> but I want to make a ListView containing photos from the Gallery of the phone. I managed to get the Bitmap from the Gallery referring to the picture the user chose and put it in a regular...

Is it possible to display original image in android without fit to device views?

android,image,imageview,image-scaling
I have an Image of size 1000px*1200px and i want it to be displayed without being scaled!. I have searched in stackover flow and google i am not getting good one. I want full image without scaled, I have tried like this Step1:- <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/image" /> Step2:- I...

Change imageview in listview row dynamically

android,listview,imageview
I have a listview with custom row which contains textview an ImageView and a button. This is my layout: Now If I add some text and select the color beside add text and click "+" the text and the color selected should be added to the listview. Still here everything...

ImageView's scale type unexpected behavior

android,xml,user-interface,imageview,android-5.0-lollipop
I have an ImageView with scaleType="fitCenter" and layout_width="match_parent", so I expect the image inside it to scale and inflate all view. Layout file: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="20dp" android:layout_marginTop="20dp" android:gravity="center" android:orientation="vertical"> <FrameLayout android:layout_width="250dp" android:layout_height="wrap_content"> <ImageView...

android imageView scale

android,imageview,scale
I have an ImageView which is populated from database (the image comes from database). in the database i have images both portrait and landscape!! how can i adjust the imageView to scale it self according to the image width and height. I have tried many ways but no result! any...

How to assign different image views in each item of the spinner?

android,android-studio,imageview,android-imageview
I want to display different image views in each items in my spinner and indicate their position. My problem is, the spinner can only display one ImageView. states = getResources().getStringArray(R.array.Facilities); imgs = getResources().obtainTypedArray(R.array.popup); image = (ImageView) findViewById(R.id.country_image); spinner = (Spinner) findViewById(R.id.country_spinner); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, states);...

ImageView Causing Crash

android,android-layout,crash,imageview,runtime-error
I am still fairly new to android development so any help is truly appreciated. I have an app that uses the light sensor to read the amount of light and display it on the screen. I am developing it on android studio. Under the title, which is a textView, is...

Android ImageView how to set initial zoom

android,imageview,zoom
I have already managed to create a view (ZoomableImageView) which will support zoom-in and zoom-out commands (pinch to zoom). What I cannot manage, is how to set an initial zoom state for the view. For example, I'm listening to a double tap event (through a gesture listener of another class),...

ImageView remove white border?

android,imageview,border
How to make this imageView full screen? No matter how I'm trying, I'm still getting that white borders on my phone, and on my emulator also, how to remove fully them?...

Android load image into imageview efficiently

android,bitmap,imageview,out-of-memory
I have next problem: To avoid OutOfMemoryError i'm loading my big images into ImageViews using Picasso in such way: public static RequestCreator picasso(final Context context, final int resourceId) { return Picasso.with(context) .load(resourceId) .fit() .centerCrop() .noFade(); } And in activity or fragment, i'm loading image into ImageView final ImageView backgroundImage =...

Image from URL in ListView using SimpleAdapter

android,listview,url,imageview
I hope you can help me with this error, I'm stuck in this for a few days. I want to show a ImageView from URL in a ListView using SimpleAdapter, but the image are showing in white. I'm recent starting with android, so, i cant understand a lot about LazyList...

Make ImageView with Round Corner Using picasso

android,imageview,picasso
I know there are lots of link available to make ImageView Round Corner. But I'm Using Picasso Library for Image Loading.. I refer the link to get result. But the Problem is that I'm Using it in ListView and for the LIstView's first item ImageView its working perfectly fine but...

I cant view the images from data base in an image view

android,database,sqlite,imageview
hi i stored the images name in a database and the images are in the drwable folder and i retrive the images name into string array(imageArray[]) list so to view it in an image view i did this but its not working imageview1.setImageResource(Integer.parseInt("R.drawable."+imageArray[pos]); any ideas ?...

Image showing in Android Studio but not on phone

android,listview,imageview
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...

Set border around imageview with no background in javafx

button,javafx,imageview,javafx-8,javafx-css
I would like to have a button or a clickable ImageView in my program. When clicked i would like to have a border to appear in a shape of the imageview. This image had no background, but i can't find a way to specify the border's shape. For example: http://vignette3.wikia.nocookie.net/forgeofempires/images/b/b8/Castel_del_Monte.png/revision/latest?cb=20130101150554...

Adding Dynamically ImageViews to horizontal scrollview in android

android,imageview,horizontalscrollview,dynamically-generated
I'm trying to show images dynamically by string as ID and want to display it in Horizontal scroll-view as i have 13 cards which can't be fit on screen Here is my code its working fine but i want it in Horizontal Scroll View int resID = getResources().getIdentifier(resourceName, "id", getPackageName());...

Universal Image Loader - Use same image in multiple views

android,imageview,universal-image-loader
I'm using Universal Image Loader to load images from a backend to display user images in a list; however, if the icon shows up multiple times, the Universal Image Loader doesn't fill out all the views. [User Image 1] - No image [User Image 1] - No Image [User Image...

Android recycled bitmap error

android,canvas,bitmap,imageview,recycle
I'm goning to resize bitmap and insert into imageView. However I encountered recycle error... error message : 05-08 13:32:48.948: E/AndroidRuntime(4792): Process: com.test.myapp, PID: 4792 05-08 13:32:48.948: E/AndroidRuntime(4792): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap [email protected] 05-08 13:32:48.948: E/AndroidRuntime(4792): at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1225) 05-08 13:32:48.948: E/AndroidRuntime(4792): at...

(Android Studio) App Background Image Doesn't Fill Screen

android,android-studio,imageview,background-image,fill-parent
I'm new to app programming and require some assistance. I am building a simple app on Android Studio, but my app's background image (I named it "green_background") doesn't entirely fill the screen. I can't provide a screenshot because I don't have 10 reputation on Stack Overflow. Here is my app's...

Round cornered ImageView supporting background color in Android?

android,imageview
I want to do a round corner ImageView. But I want it have background color (e.g., #000). With current solutions (either build an extended round corner view or paint a round corner bitmap) the background property will spoil the effect, as the view will be in a black rectangle (see...

Android avoid image scalling in Imageview for Image Mapping like Html

android,imageview,android-imageview,scale,imagemap
Hi Am trying to implement image mapping as like html in android. For that i referred this project. Its work good when i access the image from drawable-nodpi folder. But when i access from other drawable folder the image get scaled as per the android concepts. Here i used drawable...

Different picture display in real device and emulator Android

android,imageview,emulator
Different picture display in real device and emulator Android, I do not understand what is the reason <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".MainActivity" android:orientation="vertical"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageView" android:src="@drawable/music"...

How to add a gradient to a ImageView nested in a CollapsingToolbar

android,imageview,android-support-library,material-design,collapsingtoolbarlayout
I'am working on an Android app with material design. I have a detail view with a CollapsingToolbarLayout and a ImageView (works fine so far). Unfortunately the title is not readable if there is a bright image. You can find a screenshot of this issue under this link https://www.dropbox.com/s/jvdbep89yt5yrg5/device-2015-06-17-231603.png?dl=0 (I am...

Landscape and Vertical images in GridView (how to auto crop/scale)

android,user-interface,gridview,imageview
I want to present all thumbnails on device to the user, in a GridView where each "cell" is an ImageView. If all photos are landscape orientation, this looks good: Each thumbnail is rectangular and cropped to same size (I assume this is how the thumbnails are generated/stored on the device)....

Android ImageView stretches image

android,imageview,stretch,aspect
I've searched and searched and nothing seems to work to avoid my banner from stretching. I've saved multiple instances of the banner in the drawabled folders. The width of the image is: xxhdpi: 1440px xhdpi: 960px hdpi: 720px mdpi:480px When I run the app on a device with a screen...

Making thread to load multiple images in multiple imageviews not working?

android,android-asynctask,imageview
well I want to load five images in five imageviews in one single method in one activity. The images are in jpeg and are short files (500kb max) so I've tryed this code on the Oncreate: new Thread(new Runnable() { public void run(){ ins1 = (ImageView) findViewById(R.id.ins1); //and four more...

Android custom image view shape

android,imageview,android-canvas
I am working on creating a custom ImageView which will crop my image into a hexagon shape and add a border. I was wondering if my approach is correct or if I am doing this the wrong way. There are a bunch of custom libraries out there that already do...

Background image in ImageView causes crash

java,android,android-studio,imageview
I have an image called down.png in the drawables folder, but every time I run the app, it crashes on creation. This is my MainActivity code: public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ImageView sss = (ImageView) findViewById(R.id.sss); Button ddd = (Button)...

Send imageview to WCF from Android

android,wcf,post,imageview
I converted the imageview to bitmap and later to Base64 string, after that i am sending it via post to the server. I am receiving the stream in my WCF but the file that is saved is corrupted, the image file is unable to see. Android code: private void upload()...

Android drag ImageView very laggy

android,multithreading,imageview,touch
I am trying to implement a touch-draggable ImageViewin an Android app. There are loads of sample codes for this on SO and elsewhere, and all seem to be along the lines of this one. I tried something similar to this, but it was very laggy and I kept getting the...

professional way to update images in a listview in own thread [closed]

android,multithreading,image,imageview
What is an professional way to update ImageViews in a ListView like WhatsApp does? How could I realize that? Seems like the update and download sequence of the Images needs to run in it's own thread, but in which kind of thread so I don't get in trouble by changing...

Custom ListView where all the images have the same size

android,android-listview,imageview,custom-adapter
I want to create a ListView where every row have a rectangular image and some Text. Like this: The problem that I have is that some image the height is higher than width and then the ListView looks like this: This is my actual code: xml layout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal"...

Android: How to group a textview and imageview in a checkbox

android,checkbox,imageview
I want to design a checkbox look like this: I can do it on html with table. But I have no idea how to work on android. Please give me some hint!...

How to draw a rectangle on Image Bitmap in ImageView

android,bitmap,imageview
I am new Android programming. I am trying to open an image from the Gallery of a phone and draw a Rectangle on top of the image I have opened. But I am able to open the image but I am not able to see the rectangle. I am using...

How to put Like function under an image and save the “Liked” status?

java,android,android-studio,imageview,sharedpreferences
I'm trying to figure out how to put a "Like function" to a few local stored images and remember the app that the user liked those images. Let me explain: I want the user to be able to press "Like" under the image he likes. This means the "Liked" status...

Don't understand why OutOfMemory on setImageDrawable

android,imageview,out-of-memory,android-animation
Having a problem with a custom button control which I have made. The button is defined in layout like this: <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:layout_width="180dp" android:layout_height="180dp" android:layout_centerInParent="true" android:layout_margin="20dp" android:background="#fff" android:contentDescription="@string/my_button_info"...

moving Image View from point to another

java,android,animation,imageview
I would like to move an image view from one point to another when a particular button is clicked. Here's my code: int e = 0 ; Button d = (Button)findViewById(R.id.button1); d.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { TranslateAnimation move = new TranslateAnimation(e, e + 1, e, e...

Using picasso library with a circle image view

android,imageview,picasso
I am looking at using the Picasso library to download an image from URL and pass this into circle image view, but since picasso requires that you pass in an actual imageView I have come to a standstill on how to do it I am using the picasso library from...

How can I resize a ImageView from my XML?

android,imageview
I want to resize (height and width) a ImageView from XML at my Java Activty how can I do that? private ImageView imageView; imageView = (ImageView) findViewById(R.id.imageView); ...

How can i implement seek bar to change contrast

android,imageview,android-imageview,android-seekbar
I am trying to implement a seek bar to change contrast of an image in android. Anyone Help me to Implement this please.There is any other options for image processing ? Does anyone know the solution Please help me Thanks in Advance. CODE: public class MainActivity extends ActionBarActivity { ImageView...

Change ImageView src from it's own onClick() method

android,onclick,imageview
I'm making a simple Whack a mole game, and when a user taps on a mole, I want it to turn into a poof before it disappears. To do this, I'm trying to call setImageResource() from inside the onClick(), but onClick gets passed a View, which doesn't define setImageResource(). Casting...

Image scaling for tablets

android,image,imageview,tablet
I have an image I want to display in ImageView in my layout. As I don't want a distorted Image, I use android:scaleType = "center". It looks good on medium and small devices, on large devices (7" and 10"), it is to small and you can see the borders. How...

Android - Get a ScreenShot of the visible area of a Scrollview

android,imageview,scrollview
How to get a Screen Shot of the visible area of a ScrollView in Android ? My view hierarchy is as below: Scrollview - Linear layout - Imageview...

No IMvxImageHelper registered

android,imageview,mvvmcross,imageurl
I use mvvmcross and can not bind to image URL. Error: No IMvxImageHelper registered - you must provide an image helper before you can use a MvxImageView <Mvx.MvxImageView p1:id="@+id/imgArticle" p1:layout_width="49dp" p1:layout_height="49dp" p1:layout_marginLeft="5dp" p1:layout_marginTop="5dp" local:MvxBind="ImageUrl Image, Converter = Image" p1:layout_marginBottom="5dp" p1:background="#ffff0000" /> My Model: public Guid Id { get; set; }...

Image not appearing on HTC One M8

android,xml,imageview,drawable
I'm currently developing a new app for the company I'm working at. We test this on multiple devices, now a strange thing I noticed the other day, well someone else did. My Colleague tested the app on his HTC one m8, and we have a background image on the login...

ImageView inside Gridview repeating image when scrolling (using ImageDownloader)

android,gridview,imageview,repeat
As the title says, I have this problem. Because I need to retrieve images from the network, I have implemented a solution which is explained here I will post the Adapter and ImageDownloader code (I have taken the liberty to modify the downloader in order to make the functionality more...

Load Image in ImageView from URL stored in JSONString in Android

android,json,imageview
I have a JSON string, say a name and a Url . I need to extract name into the TextView and extract and display image in ImageView. Below is the code for above scenario. public static final String JSON_STRING="{\"WebImages\":{\"Imagename\":\"image_name\",\"imageurl\":http://www.example.com/image/example.png}}"; I need to display the name in TextView which I created,...

RecyclerView with only one item displayed on screen

android,imageview,recyclerview
I have RecyclerView with items ImageView. I want to make RecyclerView to display only one item at time, dragging to edge like ViewPager, when changing. Anyone knows how to achieve this? I'm using code from this source: http://hmkcode.com/android-simple-recyclerview-widget-example/ Only one difference is that I don't have TextView, only ImageView....

PopupMenu is not positioned properly inside RecyclerView

java,android,imageview,recyclerview,popupmenu
I'm making an Android app to load data into a RecyclerView with an ImageView inside as the overflow button. When users click it, a PopupMenu is displayed with options to choose. I had managed to show it but the position does not seem right. Please look at the screenshots. Only...

Can't adjust ImageView on Android API below 16

android,android-layout,imageview,adjustment
I want to set a background image in my app, which will fill all screen and scale if needed, so I set it in my main_layout.xml like that: <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:id="@+id/imageView" android:src="@drawable/bg_iphone_6_plus" /> and it looks like this not very good, I need this picture to adjust in...

Covering android ImageView

android,imageview
While I was working on my project I found that the image couldn't cover the whole space of ImageView completely! this is the first time that i have got a problem like this. Here is my code : int ImgId = getResources().getIdentifier("test1", "drawable", getPackageName()); Photo=new LinearLayout(this); lp = new LinearLayout.LayoutParams(Width/2,Width/2);...

Android ExpandableListView item images disappear

android,listview,imageview,expandablelistview
I have to display a list of football players in a list. No problem about that, everything works fine but the little flags for the nationality are disappearing while I scroll down my list. Here is what it should look like : list item player OK And here is the...

Having trouble with moving a drawable in Android

java,android,android-layout,imageview,android-drawable
I'm having trouble with some code I've set up that allows me to move an imageView's drawable to another imageView simply by clicking on the two imageViews (one with source image and then destination imageView) in succession. The goal is to simulate a chessboard. My starting display is the following:...

Add or Remove ImageView dynamically

android,imageview
Is there any way to add or remove android imageview in UI dynamically ? I have 2 objects : List view and image view. I want to show each other dynamically without crashing each other.

how to show multiple images in imageview in android

android,imageview
I am trying to show several images in an activity.And user can view them by scrolling.I have done this by adding two ImageView for two image.But there is huge space/gap between two images This is looking very unsmart.How can I solve this problem. Can I make one ImageView to show...

how do I set an Image which is Received in a Json Object thorough a web service as a response below…?

android,json,imageview,http-post,bytearray
how do i decode this to show in an ImageView...? in Android...

Change colour of imageView programatically

android,layout,imageview
I would simply like to change the colour of an imageView object using code, but it appears to be proving a lot more difficult than it sounds. Here is my xml for the object: <ImageView android:id="@+id/lifeSquare" android:layout_width="50dp" android:layout_height="30dp" android:background="#2a80b9" android:visibility="invisible" android:adjustViewBounds="false" android:clickable="true" android:cropToPadding="false" android:padding="0dp" android:scaleType="fitStart" /> It's just a blue...

Android XML Layout - ImageView taking all space

android,imageview
This is my first post on Stackoverflow. My question is related to ImageViews : I have a simple XML layout file composed of two LinearLayouts included in a general LinearLayout. The first LinearLayout contains a simple ImageView, and the second one contains three buttons. My problem is that the ImageView...

setImageBitmap in gridview does not scale the image to fit

android,gridview,bitmap,imageview
Note: This problem only happens in gridview, if you setimagebitmap in a single imageview, it works well. See the following pictures, The left picture is what I want, and the picture on right is what actually I get. The only difference is the way I set the image, if I...

custom ArrayAdapter ViewHolder : imageView changes for several items in Listview not for one only android,listview,android-listview,imageview
ok i encounter a problem with this custom ArrayAdapter public class AuthorsAdapter extends ArrayAdapter<Entity> { View row; static class ViewHolder { TextView textViewTitle; TextView textViewEntitySummary; ImageView imageViewPicture; } public AuthorsAdapter(Context context, LinkedList<Entity> entity) { super(context, 0, entity); } @Override public View getView( final int position, View convertView, final ViewGroup parent)...

ImageView scaleType doesn't work

android,imageview,scaletype
I have a ImageView which contains a little "?" as image. This image gets stretched and looks ugly. So I tried to set the ImageView.ScaleType-property to fitCenter but it doesn't have any effect. I tried all other scaleTypes too, but non of it affects my layout. Since the user will...