imageview

Android ocasionally downloads images from url

六月ゝ 毕业季﹏ 提交于 2020-01-07 03:17:09
问题 A part of my application is to download images from a url and parse them to listview and single imgaview. Generaly it does not work, however some images appear occasionally. public class ImageLoader { MemoryCache memoryCache=new MemoryCache(); FileCache fileCache; private Map<ImageView, String> imageViews=Collections.synchronizedMap(new WeakHashMap<ImageView, String>()); ExecutorService executorService; public ImageLoader(Context context){ fileCache=new FileCache(context); executorService

How to create a button on top of ImageView and align it to the bottom of the screen?

强颜欢笑 提交于 2020-01-07 02:18:28
问题 I want to have a button on top of ImageView using my xml file. When I run this code, the button appears to the left hand side of the screen on top of other buttons. Does anyone have any idea on what to do to have a button on TOP of ImageView but at the bottom of the screen. So far I have the following: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...... <ImageView android:id="@+id/filter_image_view" android:layout_width=

How to create a button on top of ImageView and align it to the bottom of the screen?

天大地大妈咪最大 提交于 2020-01-07 02:18:24
问题 I want to have a button on top of ImageView using my xml file. When I run this code, the button appears to the left hand side of the screen on top of other buttons. Does anyone have any idea on what to do to have a button on TOP of ImageView but at the bottom of the screen. So far I have the following: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...... <ImageView android:id="@+id/filter_image_view" android:layout_width=

Resize AlertDialog to fit image exactly

假装没事ソ 提交于 2020-01-06 19:54:16
问题 I have the following AlertDialog with an image inside it: As you can see there is a small gap just above and just below the image. I'd like to remove that gap. My layout xml looks like: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/alert_thumb_root" android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:id="@+id/thumb" android:layout_width="wrap_content" android:layout

How to toggle flip Imageview horizontally in android

孤人 提交于 2020-01-06 19:29:39
问题 I have an Imageview and I want to flip picture horizontally whenever user click on the Button named "Flip Picture" . and when User click this button second time it should return to orignal state in other words flip back. So it should repeat this behavior. I found this useful code to flip the image view with out using external library , but do not know how to flip back: Here is the Code : public Bitmap flipImage(Bitmap src, int type) { // create new matrix for transformation Matrix matrix =

how to setImageResource in listview?

和自甴很熟 提交于 2020-01-06 16:18:20
问题 i store image name in sqlite, i get names with a query and i need to set image resource. i try this : ImageView img_categlist = (ImageView) findViewById(R.id.img_categlist); int imageid = getResources().getIdentifier(Image[position], "drawable", getApplicationContext().getPackageName()); img_categlist.setImageResource(imageid); int save = db.sh_categtest("charterdb", "test"); Image = new String [save]; for (int i = 0; i <save; i++) { Image[i]= db.nam_nametest("charterdb", "test", i, 15); }

Error in displaying an image in a listview

梦想的初衷 提交于 2020-01-06 15:32:30
问题 I have an image resource ID in an SQLite database and I would like to display this image in a list view. I have created a row template but the default image is displayed in the list. How do I update the image src? to populate the list view, I use the following code ListView listView = (ListView) findViewById(R.id.winnerListView); int[] viewColumns = {R.id.winnerPositionView, R.id.winnerIcon, R.id.winnerNameView, R.id.winnerScoreView}; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this

Android ImageView zoom, rotate, position change prob

自古美人都是妖i 提交于 2020-01-06 15:01:19
问题 I am using a the following code for a image, which will rotate, zoom in-out with pinch. User can make its position by dragging it. activity_img_match.xml <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/brokenbone" android:gravity="center_vertical|center_horizontal" > <ImageView android:id="@+id

OutOfMemoryError in my gridAdapter

…衆ロ難τιáo~ 提交于 2020-01-06 14:52:14
问题 I'm trying create adapter for my gridView which should contains photo, which I chose in gallery. But I have following OutOfMemoryError in line "return row" public class GridViewAdapter extends ArrayAdapter<String> { private Context context; private int layoutResourceId; private ArrayList<String> images_urls; public GridViewAdapter(Context context, int layoutResourceId, ArrayList<String> images_urls) { super(context, layoutResourceId, images_urls); this.layoutResourceId = layoutResourceId;

Android: ImageView in center screen

杀马特。学长 韩版系。学妹 提交于 2020-01-06 14:44:06
问题 I have a background image in full screen with a RelativeLayout . And other image (100x100) in an ImageView . I want to put the ImageView in center screen. But my image shows top left. What is the problem? XML <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/fondo_inicio" > <ImageView android:layout_width="80dp" android:layout_height="80dp" android:layout_gravity=