android-imageview

Android “attempted to access a cursor after it has been closed”

非 Y 不嫁゛ 提交于 2019-12-24 03:44:09
问题 I'm trying to adapt the HelloGridView example so that I can show image thumbnails of images stored on the SD instead of images in the res/drawable. The idea is to create a list with the images first in the ImageView.initialize() function and the use it pretty much exactly as in the example. I'm having trouble with my cursor, first I tried to have it as private in the Imageview.initialize() function (it's only commented away so you can see where I had it) since to me it seems like it is only

Android “attempted to access a cursor after it has been closed”

空扰寡人 提交于 2019-12-24 03:44:06
问题 I'm trying to adapt the HelloGridView example so that I can show image thumbnails of images stored on the SD instead of images in the res/drawable. The idea is to create a list with the images first in the ImageView.initialize() function and the use it pretty much exactly as in the example. I'm having trouble with my cursor, first I tried to have it as private in the Imageview.initialize() function (it's only commented away so you can see where I had it) since to me it seems like it is only

Android - Loading Image Url and Displaying in ImageView

大兔子大兔子 提交于 2019-12-24 03:15:59
问题 I have this code to load an image. The server is secured. I got a response: 200 which means okay. Then also the right url is to be loaded. The problem is when i run my app, the image wont be loaded. try { Bitmap bitmap=null; URL imageUrl = new URL(url); String userPass = username+":"+password; String encode = Base64.encodeToString(userPass.getBytes(), Base64.DEFAULT); HttpURLConnection conn = (HttpURLConnection)imageUrl.openConnection(); conn.setRequestProperty("Authorization", "Basic " +

ImageView in CardView not show radius on Android 4.3

為{幸葍}努か 提交于 2019-12-24 02:22:34
问题 Here my layout xml: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/catalog_item_card_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" card_view:cardCornerRadius="5dp" card_view:cardUseCompatPadding="true"> <android.support.constraint.ConstraintLayout android:layout_width=

Zoom Image View on pull down

邮差的信 提交于 2019-12-24 01:19:18
问题 I have a view with structure like <ScrollView> <RelativeLayout> <ImageView> <LinearLayout> <!-- Here I show some details in textview--> </LinearLayout> </RelativeLayout> </ScrollView> Now I what i want is when i scroll down or drag down the linear layout I want to increase the ImageView size with the scroll down amount and when I release the drag/scroll it should become as initial size.This is done in Path android app. I need idea to achieve this, please help if anybody did this. 来源: https:/

Unable to set picture as. “No appps can perform this action”

假装没事ソ 提交于 2019-12-24 01:06:58
问题 I am trying to give users an option to set image as wallpaper/whatsapp dp like this. But I'm stuck with this code Uri sendUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.a_day_without_thinking_mobile); Intent intent = new Intent(Intent.ACTION_ATTACH_DATA); intent.setDataAndType(sendUri, "image/jpg"); intent.putExtra("mimeType", "image/jpg"); startActivity(Intent.createChooser(intent,"Set As")); It shows a dialog that no apps can perform this action. I also tried to

Add Image at above of listview

我与影子孤独终老i 提交于 2019-12-24 01:01:54
问题 I would like to add imageview at above of listview. I knew about add section hearder in listview. But i just wanna save my time so i used image view for listview header instead of using addSectionHeader. Unfortunately i just stuck in with some xml properties. Image Overlay at my list view. Actually image supposed to be at the above of list. Check out my xml layout. Thanks. <?xml version="1.0" encoding="utf-8"?> 回答1: this link states the same as of your problem EditText wont display above

Android Studio How to check which Imageview has clicked and assign an Int value to it?

好久不见. 提交于 2019-12-24 00:22:34
问题 ActivityOne I have 12 Imageviews. User click on either 1 of them. If they click ImageView 1, we assign a int value to it (image_id=1; ) ActivityTwo Use a If else statement to check which image has they clicked Intent result_intent=getIntent(); if (image_id==1) { text.setText("U have clicked image "+image_id); } I need the int value in ActivityTwo as I need to calculate sth. Anyone can help? Thx 回答1: @gosulove setOnClickListener on your all ImageViews Like this In your Activity 1 ImageView1

Add String to ImageView Object Android

女生的网名这么多〃 提交于 2019-12-23 22:00:51
问题 I need to attach a String into the ImageView object so that I could do something like imgView1.getString() and it would return it. I know there is getTags and setTags but from my understanding that just uses ints. Thank you 回答1: Just complementing @dharms answer, you can set any Object as the tag for the ImageView , whether is an int, double, String, etc. So in your case you can do this: imgView1.setTag("some_string") and then to retrieve it just do: String someString = (String) imgView1

Scale and center matrix on arbitrary point

跟風遠走 提交于 2019-12-23 21:34:52
问题 I'm using a custom ImageView to display a rather large bitmap. The bitmap display is being handled by a matrix that transforms it to what the user sees. I'm trying to implement a "double-tap-to-zoom" but I can't quite get it right. I'm trying to have the image zoom on the point where the user touched with this point ending up in the center of the screen at the end. I worked through a lot of the matrix math and transformations and basically the following transformation is what I need to do