Can't set background image for android - android

I have a problem for set an image in background. I use background tag but there is an error I don't understand! see below pictures.

Sometimes resources get out of sync with the file system. Do a refresh (select project in resource explorer and press F5).

Use the following tips.
Resize the background image in to a smaller resolution and size.
Use only *.PNG images.

Try to clean your project from Project>Clean..

Related

Image in android?

My ImageButton in my app is very tiny and cut off. I realized this could be because the image was in the drawable folder instead of the mitmap folders. So, I copied the images from the drawable folder, and pasted them in mitmap folders. Now, should I go about deleting the image from the drawable folder? I get the following saying it is not safe:
I know how to access the images, but should I delete them from the drawable folder now that I have already moved them to the mitmaps? If I do a delete anyway, will I need to alter my code to access the mitmap image? What is safest to do?
Here is an image of my mitmaps:
Thanks for the expert advice,
Rich
"Not safe" in this context just means that it's still being used somewhere. If you delete it, the current usage will fail to compile, and you'll be easily able to find and alter it to point at the new location.
You can safely delete this image, in Android Studio if you are using this image or else the file will be open at some place, you can get this error actually, so try deleting this image will safely remove the only selected image into your workspace. So hassle free to delete it.
After deleting your image, clear your project and run it, it works fine.
The mipmap folder is used for image that are very small and should be used in the action bar, and other menus. If you find your image too tiny, it just will be worst if you put it in the mipmap folder. If it's tiny although the image is in the drawable folder, maybe the image has a very small dimension or your imageview is too small.

How to prevent a drawable from becoming blurry?

When i copy-paste an image to the drawable file, i get one image with the original resolution. When i use the New--ImageAset way i get a lot of images for different screen densities but they are all blurry, even xxhdpi! How can i have the different densities inages without this problem?
Im surprise i didnt noticed it before!
I read this but it hasnt helped me
Android ImageView blurry?
http://developer.android.com/guide/practices/screens_support.html
Any advice am i doing it wrong?
EDIT
I tried the AndroidAssetStudio but it still happens
Before
After (xxhdpi)
Cant i get it to be the ldpi and then make it scale up from it or something?
You can create your image in different resolutions using Android Assets Studio. Then, copy paste the image to the respective folder. This will give you a proper image, without blur.
There is a plugin exactly made for the same purpose. You can use that plugin to make different sizes of the same image. You have to copy/paste a single image in drawable folder. Then right click drawable folder and select
NEW>Batch_Drawable_Import. Select the size for your image and it will itself make the other sized images for you.

How get I the Android Core Checkbox Image files

I want to use the standard checkboxes of Android, but I want to change the border color a little. Is there any option to get the original drawables as .png files?
I would like to get all these pictures:
Thank you & greetings,
Malte
Go to your ....\your AndroidSDK\platforms\android-11\data\res\drawable-mdpi\btn_check_off_selected.png
you can get all images which android system used.
Thats it

Cannot change the image background in android using eclipse

I have a problem in changing the image background in Android using Eclipse.. I already replaced the previous image but then when the emulator run it always appears the replaced image.Pls help to solve this.Thanks
So what you are saying is that even after you replaced the images those images are still shown. Make sure that you replaced the previous images in all of the drawable folders. Because if you just replaced the drawable-hdi images but not the drawable-mdpi ones than if the emulator or device has a mdpi screen it will load the mdpi images from the drawable-mdpi folder thus showing the older images. So make sure you replaced all the images and not just in one folder.
Simply add android:background="#drawable/backgroundmenu" in your Layout section in XML activity
But first, import an image called "backgroundmenu" in drawable.
you need to clear your files in drawble folder in this location; ..\eclipse\workspaces\YourProjectName\bin\res\crunch\drawable
clear all files there, good luck!

Couldn't change an old splash image with new image on android app

I tried to change the splash image in my android app with a new image, by changing the image in the drawable folder and I giving the same name to new image.
In my Eclipse environment I can see new image on the splash.xml file but when I run the code I see the old image on the emulator. What is wrong?
I think that splash image is also present in any other folder like drawable-large,drawable-small .
So Please check all the folders.
Please Clean your project once and check again.
If the application has multiple resolutions of the splash image, you need to change them all.
/res
/drawable
/drawble-xhdpi
/drawble-hdpi
etc...

Categories

Resources