android-imageview

How to make a dynamic ImageView?

点点圈 提交于 2019-12-11 22:01:31
问题 I need to make an app with some Images, and one that it's in the center needs to change his size depending on the size of the screen. Here is the code, the image that I need to change it's the image4: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" android:gravity="center_horizontal" android:orientation="vertical" > <ImageView android:id="@+id/imageView1"

Null pointer exception when getting image from url to put in imageview

為{幸葍}努か 提交于 2019-12-11 19:45:50
问题 I'm getting my image through an URL and trying to set that to my imageView. But I'm getting a Null Pointer Exception. It is not even entering my asynchtask. Is there something I'm doing wrong or not seeing? public class DetailsActivity extends Activity { ImageView thumbnail = (ImageView) findViewById(R.id.btnThumbnail); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.detail); final Bundle extras = getIntent().getExtras

Android custom layout listview with images

可紊 提交于 2019-12-11 19:44:08
问题 I would like to manage to obtain a listview with dynamic items. I built a row_layout containing an ImageView, and 2 TextViews. When I build the adapter, I want to be able to display the ImageView OR NOT depending on the row number. So I want to have img1 on row 2, img2 on row 3, then img3 on row 5. And on all other rows I do not want any imageView displayed (and also the alignment of the textviews must change filling the empty space left by the ImageView missing). Is that possible? I populate

Partial UI screen up

醉酒当歌 提交于 2019-12-11 18:09:40
问题 In a screen, I have a edit text on top (large contains space for 4-5 line), image view below that and submit button at bottom. on Keyboard up it should not hide my submit button. when keyboard appears i am able to resize the window using android:windowSoftInputMode="adjustResize" which allow me not to hide the submit button but it resize my image also which i don't want. Only submit button should move up when keyboard is visible without resizing image. I tried frame layout also but it didn't

SQLite BLOB column to SimpleCursorAdapter with ViewBinder

≯℡__Kan透↙ 提交于 2019-12-11 17:53:28
问题 I'm trying to display a list of contacts that are currently stored in a SQLiteDatabase . Previously I've retrieved ContactsContract.Contacts.PHOTO_THUMBNAIL_URI and stored it in a form of byte[] in the BLOB column of my database rows. Now when I'm trying to extract the thumbnails back, by decoding them to Bitmaps in MyBinderView class, the pictures don't appear, instead I see empty spaces(the default image, ic_launcher , is showed correctly). My ListView row layout: <?xml version="1.0"

How to drag images from one imageview and drop to another image view.

牧云@^-^@ 提交于 2019-12-11 17:33:42
问题 public class Quiz extends Activity { int windowwidth; int windowheight; ImageView ima ima2; private View selected_item = null; private int offset_x = 0; private int offset_y = 0; private android.widget.LinearLayout.LayoutParams layoutParams1, layoutParams2; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.quiz); windowwidth = getWindowManager().getDefaultDisplay().getWidth();

Bitmap of x cm's width and y cm's height

邮差的信 提交于 2019-12-11 16:42:04
问题 I am taking a picture using camera in my app and will email the picture to a certain email address. now i want the emailed picture's physical dimensions to be 10cm's in width and 8cm's in height. and the code i have tried is as follows: 1) declare a imageview in xml like below : <ImageView android:id="@+id/imageView3" android:layout_width="100mm" android:layout_height="80mm" android:src="@drawable/ic_launcher" /> 2) and later in java file : final BitmapFactory.Options opts = new BitmapFactory

Select Content inside ImageView - Android

柔情痞子 提交于 2019-12-11 15:51:47
问题 I have an Activity containing an ImageView and I'd like to allow the User to select part of it's content with the touch (or mouse click) capabilities. I'd like to write a procedure able to achieve two things: Draw a highlighted window over the selected parts of the image Return an object containing the coordinates of the selected (highlighted) pixels. For better understanding you can check the little mock up I've created: The User should touch the screen over some part of the image and it

store image to SD card

左心房为你撑大大i 提交于 2019-12-11 15:26:10
问题 i'm using cropping functionality in my android application and it works fine but i want to save cropped image to my SD Card . For that what steps needs to be followed? 回答1: If the Bitmap you cropped is called yourBitmap File sdcard = Environment.getExternalStorageDirectory(); File f = new File (sdcard, "filename.png"); FileOutputStream out = new FileOutputStream(f); yourBitmap.compress(Bitmap.CompressFormat.PNG, 90, out) 回答2: Try this : public void saveBitmap(Bitmap bmp) { String file_path =

selector not properly set the image

99封情书 提交于 2019-12-11 15:11:36
问题 i have two images to show it for two different state ,normal and presses. Image for pressed state is slight more bigger in size than in normal state. problem:when i am pressing it changes the image but it wont change the size of the imageview it compresses my image and show me image with same size as image in normal state. I have given wrap_conten for width and height in my xml file. this is my selector class whose refernce i am giving in imageview's src property. <selector xmlns:android=