Note that there are some explanatory texts on larger screens.

plurals
  1. POWrong resolution from imageView Android
    primarykey
    data
    text
    <p>I have a gallery in my application, but when i load the pictures i have the same resolution like the image below. These images are resolution 300x300. Even increasing the resolution the images shows me the same resolution..</p> <p><img src="https://i.stack.imgur.com/7ol76.png" alt="enter image description here"></p> <p>Can you help me?</p> <p>My Adapter</p> <pre><code>public class ImageAdapter extends BaseAdapter { int mGalleryItemBackground; private Context mContext; private Activity activity; private ArrayList&lt;String&gt; urls; private ImageLoader imageLoader; private int largura; private int altura; public ImageAdapter(Activity acivity,Context c,ArrayList&lt;String&gt; urls,int largura, int altura) { this.activity = acivity; this.urls = urls; this.largura = largura; this.altura = altura; mContext = c; TypedArray a = mContext.obtainStyledAttributes(R.styleable.MapAttrs); mGalleryItemBackground = a.getResourceId( R.styleable.HelloGallery_android_galleryItemBackground, 0); a.recycle(); imageLoader=new ImageLoader(activity.getApplicationContext()); } public int getCount() { return urls.size(); } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { int largura = this.largura; int altura = this.altura/3; ImageView i = null; if(convertView == null) i = new ImageView(mContext); //i.setImageResource(mImageIds[position]); i.setDrawingCacheQuality(100); i.setScaleType(ImageView.ScaleType.FIT_XY); i.setBackgroundResource(mGalleryItemBackground); //i.setLayoutParams(new Gallery.LayoutParams(largura,altura)); i.getLayoutParams().height = 300; i.getLayoutParams().width = 300; imageLoader.DisplayImage(urls.get(position), i); return i; } } </code></pre> <p>Display Image</p> <pre><code>public void DisplayImage(String url, ImageView imageView) { imageViews.put(imageView, url); Bitmap bitmap = BitmapFactory.decodeFile(url); if(bitmap!=null) imageView.setImageBitmap(bitmap); else { queuePhoto(url, imageView); imageView.setImageResource(stub_id); } } </code></pre> <p>Layout </p> <pre><code>&lt;Gallery android:id="@+id/gallery" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="5sp" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload