Note that there are some explanatory texts on larger screens.

plurals
  1. POLow quality image android development
    text
    copied!<p>I made a photoshop image 480x2500 which I want to put in one of my activities. But, after installing the .apk, the image has low quality. I really tried everything I found on google, without results. I'm not an experienced programmer so please take you time and explain everything that can help me. Here are my codes:</p> <p>XML:</p> <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dip" android:tileMode="repeat" android:dither="true"&gt; &lt;ImageView android:id="@+id/imageView2" android:layout_width="fill_parent" android:layout_height="1166dp" android:adjustViewBounds="true" android:scaleType="fitXY" android:src="@drawable/secondbutton3" /&gt; </code></pre> <p></p> <p>Java Code</p> <pre><code>import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.PixelFormat; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; import android.view.Menu; import android.view.WindowManager; public class Secondbutton extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_secondbutton); getWindow().setFormat(PixelFormat.RGBA_8888); getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER); BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; Bitmap gradient = BitmapFactory.decodeResource(getResources(), R.drawable.secondbutton, options); findViewById(R.id.imageView2).setBackgroundDrawable(new BitmapDrawable(gradient)); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_secondbutton, menu); return true; } } </code></pre> <p>I tried to erase a tiny part of my image(to have a transparent background) but without results. Thank you.</p>
 

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