0

So, I have a holo light theme, I am developing for android 3.0 and in my main.xml graphical layout shows a black screen which is what i want, but when I run the app on my android emulator version 3.0, it has a white background.

I want to have a black background, but main.xml layout shows me black background only the emulator shows different, why ????

Thanks, I have been developing for a week, but it's quite annoying. Thanks !!

user2547460
  • 87
  • 1
  • 3
  • 11
  • On what device are you testing this - thus, what's the Android version on the Device and what's the Theme used, because one and the same Theme name can mean something else in another Android version. – g00dy Aug 02 '13 at 14:35
  • using android version 3.0 theme: holo.noActionBar, emulator: Nexus 4 Android 3.o – user2547460 Aug 02 '13 at 14:41
  • Well, it seems that you're using 3.0 everywhere, so please paste the `main.xml` so to see how you use this Theme and if there's acolor/theme selector - paste it too. – g00dy Aug 02 '13 at 14:43
  • now it works!! but other tips, you have ? or other ways you can suggest me ?? thanks! – user2547460 Aug 02 '13 at 14:49
  • Well, if you set the background to "#000000" - it's black alright, the white color is set from somewhere else. – g00dy Aug 02 '13 at 14:50
  • Search in your code for the string "FFFFFF" and you'll find the place where it's set to white. – g00dy Aug 02 '13 at 14:59

1 Answers1

0

Eclipse - Android Graphical XML Editor

The key is to customize Android Graphical XML Editor(Lets call it AGXE) properly to match the exact outcome of your program. For this purpose there are several ways of customizations are available.

In your case you are using Holo.Light the for your application, in your AGXE theme customization(in the light blue highlight) might be Holo/Theme.Holo (or something else) which has a black appearance for blank space.

If you want to know how your app layout will look in Holo.Light theme you have to manually set your theme to Holo.Light/Theme.Holo.Light

There are other controls in the AGXE, which can be used to get the most accurate representation of your layout in real life/emulator you specified (highlighted)(If you want explanations for each ask in comments below).

If you want to set a black background as Theme.Holo, you just have to put a single line code in all your layout android:background="#000000" which will set your entire background as black instead of white (even in Theme.Holo.Light), or you can specify your theme as Theme.Holo.

Read more here

Yash Krishnan
  • 2,653
  • 1
  • 18
  • 22
  • Oh!!! Thanks !! What a useful and helpful user you are! Thanks! Well, now I understand but one question I have, I could not figure out what the web browser icon(highlighted in purple) stands for? – user2547460 Aug 02 '13 at 17:27
  • And also the icon highlighted in brown? what does it mean? Thanks again!! – user2547460 Aug 02 '13 at 17:28
  • However there are themes(which is suppose to be common in all android), different android platforms treat same theme differently, so there will be slight variations across platforms. This selector (brown one with an android icon in it) allows you to view an approximate preview of the app in each version of android platform – Yash Krishnan Aug 02 '13 at 17:40
  • Thanks and tha web browser icon selected in purple? – user2547460 Aug 02 '13 at 18:09
  • That is for language selection (translation), needed only if you use any foreign languages other than English. This one helps to render the complex languages (eg. Arabic, Hindi, mostly everything other than English) – Yash Krishnan Aug 02 '13 at 18:18
  • Ok thanks for everything! you helped a lot to an amatour developer! May I ask you if you published any apps to the market? – user2547460 Aug 02 '13 at 18:22
  • None as myself, I work primarily as an Android/Java/PHP/SQL trainer on my own. However in some occasions I coded for my friend's projects (some of them are in android). :) – Yash Krishnan Aug 02 '13 at 18:30