can't change action menu icon in android app - android

It's less than I can't change it, (Since I already did), and more and issue that I can't change it BACK.
So I'm using eclipse to learn android app development. In one of the tuts on the android developer website, it says you have to add your own ic_action_search.png file for the action bar to find. (Else it won't compile). So I made my own goofy looking icon. I added it, and it's there. Ok.
So Afterwards, I found the Android Design Icon pack from google. It looks much better and decided to plug that back in. I thought that would be easy. I took the new file, (With the EXACT same names), and plugged them back into the source folder where the others were. It OVERWROTE the other files and I have confirmed that the correct icons are now in there.
When I run the program using USB debugging on my phone though, the OLD icon is still there.
I tried refreshing the folders inside eclipse. I tried uninstalling the app from my phone and then re-installing fresh using USB debugging in eclipse. Still no go.
I'm worried that my device stored those images somewhere in my phone and isn't overriding them on the new install. Really need help with this here.
Any ideas?

Refresh your project F5
Go to
Project > Clean
if that doesn't work delete /gen and /bin folders of your project to recreate all the references of your resources.
probably you are uploading an .apk file with the old resources

Related

drawables not in app directory and not adressable

i recently started the android tutorial from android.com, after downloading and installing Android Studio and the sdk. I made the first app and all, working directory is on a Flashdrive, Android Studio and sdk are on the HDD.
I'm currently stuck at the "Adding action bar buttons" tutorial, as android studio doesnt find "#drawable/ic_action_search".
I understand that it should be in the MyfirstApp/app/src/res/drawable- folders, but those are practically empty (see picture below).
I did find an answer on here that states to simply copy the required drawables from sdk/platforms/android-/data/res/drawables-.
Another one states, I can adress "standard" pictures (like the search action icon in my case) by using "#android:drawable/ic_action_search", but that doesnt work at all.
Is there a good workaround, easier then putting every icon in every corresponding folder, every time i need one? The tutorial doesnt have that, it seems the guy writing the tutorial relied on the icons just being there?
(May solve itself with 1.)
In that other folder, there are many, many drawables, but the one folder I searched (drawable-hdpi) doesnt even have an icon called ic_action_search.png so...where do I usually get that?
Thanks for helping, I'm still hoping this is a common mistake so there's an easy solution here^^
Edit: manually starting the gradle build task doesn't work either, same problem.
()
Does your project build? Try running the gradle build task manually.
screenshot

Android application problems in Eclipse

I'm a .NET developer but I like JAVA so in my free time I play around with that. I don't normally use Eclipse but I installed the ADT eclipse plugin and Andriod SDK and I started learning and I made a new project with a TableLayout and it kinda looks good, and it runs ok on the emulator.
However... there a few things that drive me absolutely catatonic and perhaps I am doing something wrong so please help me out.
Firstly, if I change the main.xml file in whatever way, even by adding what is supposedly a correct parameter, it will start freaking out and will generate an error that just says "error" without specifying what that is, it will then generate a main.out.xml and then report an error that the main.out.xml is empty. It later won't let me delete that and will start generating a main.out.out.xml and so forth, even after I correct that original xml that caused the error.
The only way to get things going is to delete the bin folder, restart Eclipse, delete all the out xml files and then sometimes it will run the application or some other times it will start generating those 'out' files again and the loop goes on.
That way it takes hours to run a simple app even one without errors that used to run before.
Surely that was NOT how they intended it to work, is it??
Also.. there is no "Rebuild" button that will flush all files out automatically, or is it hidden somewhere? I am tired of manually deleting those automatically generated files and the build folder and all those out.xml files.
Also, while I'm at it, I also want to point out that the designer view sometimes disappears and there is nothing on earth that will bring it back, the only way is to create a new project and copy the main.xml to it and then it shows up again. Another bug?
I have the latest eclipse version:
Version: Indigo Service Release 2
Build id: 20120216-1857
If you have any clues how to get this to work, I will appreciate it!
Many thanks in advance
When you click the Run button with an XML file selected, Eclipse is running an XSL Transformation on that XML and producing the .out.xml file as the result. This is a feature of the Eclipse Web Tools feature, which you'll have if you installed the Eclipse for Java EE Developers package (it may be included in other packages, too).
As others have said above in the comments, to run your Android app, select the Project, right-click, and choose Run As > Android App. Once you've done that once, it will create a Launch Configuration that you can launch from the Run or Debug toolbar buttons (pressing the small down-arrow on the Run or Debug buttons brings up a list of Launch Configurations that you can select from, as well as an option to manage them).
There is a Preference that will make Eclipse always launch the last thing you ran or debugged, instead of trying to be smart about what is currently selected. Open the Preferences and navigate to Run/Debug > Launching; there you'll find the option under Launch Operation at the bottom of the window.

IntelliJ Android cache build with drawables ignores changes

I have a minor issue with the way IntelliJ caches files or builds (not sure about terminology here).
Situation Abstract:
Library module
DrawableA
DrawableB
App module
DrawableA
Assume library images are black and white, App ones are color.
The app shows (correctly) the colorful A.
The app shows (correctly) the black and white B (means its missing).
Now I add an image to App project, Drawable B, in color.
If you simply press "run" he will keep using black and white B
If you "rebuild project" he will use the correct one
If you try "Make" and "Compile" manually on Lib and App NO EFFECT
To clarify, this issue is really special. It only occurs if the DrawableB is NOT present in the App module. If you have it, but the WRONG one, and you update it, it works. I assume its an internal caching of IntelliJ, and he does not recognize that I added a drawable (and he has to use it from the App now, not the LIB). Perhaps its something in the google build of Android projects, not enough info about the internal here...
I know, the obvious tip is "do a rebuild of the whole project" - that said, I have 18 App modules, each for one App. The rebuild takes forever (on one of our machines without SSD), and its not neccessary. If I change something in e.g. AppX, I only need to rebuild AppX and the Library. But there seems to be no option for it.
Does anyone know a workaround, like deleting BIN or other cache folders via script? Cant split up the modules in different "projects", would loose refactoring capabilities.
Crosspost here, check before wasting time to answer (this site here is more frequented and faster, but this issue is so specific, cant hurt to ask the developers too)
http://devnet.jetbrains.net/message/5446674
Try to rebuild project. Smtm i have same problem and it helps me.
Can you try it with the new IntelliJ Idea version 12? It seems to handle cached resources pretty well.

Eclipse hangs when trying to add menu.xml

I've recently starting developing with the android sdk. Currently, I am trying to add code to use a menu, however, when I try to add a menu.xml under res/menu, Eclipse hangs and freezes every time. When I reopen the Eclipse, menu.xml is there, but every time I try to open it, Eclipse hangs and freezes again.
I am running on OS X Snow Leopard, Eclipse 3.6.2 and the latest android sdk and adt plugin.
Any help, insight, thoughts?? I am thoroughly stuck.
Thanks.
Dustin
Thanks for the input guys. What ended up working for me was instead of trying to manually create a new menu.xml file, I find the add android .xml wizard and using it instead allowed me to add whatever I needed with out any hang ups.
Same problem happens for me even under the latest version of Eclipse (Helios). If I wait long enough, Eclipse reports a stack overflow exception and then this shows up in the Output window:
W/ResourceType( 5124): Bad XML block: header size 0 or total size 9949440 is larger than data size 0
menu.xml:1: error: Error parsing XML: no element found
This indicates that the XML parser isn't handling empty documents and the Android menu editor is barfing on the newly created file while trying to open it. I'm sure there is some "standard" way of creating a new menu that doesn't break the IDE but I have no idea what that method is. I'm too used to editing my files by hand but this crash/hang bug is a serious nuisance.
Dustin,
I think what has happened is, your settings have become corrupt. I highly recommend resetting all your settings. Keep in mind, you will have to re-import all your projects so this can be quite a pain, but I really think this will fix your problem.
To start, find your workspace folder and rename it to something like "workspace-bad"
Then, create an empty workspace folder to replace the one you just renamed.
Lastly, open eclipse and it will act just like a brand-new installation.
You will need to re-import your projects, which can be done by going to eclipse, hitting File>Import...
Then select under General
"Existing Projects into Workspace"
then hit "Next" and then hit "Browse" to find the root directory
also make sure "Copy project into workspace" is checked
I also recommend doing your "problem project" first, that way you don't waste your time doing the rest and then find out you have to re-create it.
I'm hoping that fixes it for you, good luck! :-)
-Jared
I ran into the same issue with the same setup. Right clicking menu.xml, selecting 'Open With', and selecting Xml Editor seemed to be a viable workaround for me.

Content Assist not working in Eclipse for Android

I've been working in Eclipse programming for Android for about a year now. I suddenly have an enormous problem. Here is the error:
"Content Assist" did not complete
normally. Please see the log for more
information.
java.lang.NullPointerException
I go to Help>About Eclipse SDK>Installation Details>Configuration>View Error Log and it is nothing but a blank page. No errors at all.
I tried researching online. The most relevant pages I could find are http://forums.adobe.com/thread/455543 and http://www.themorphicgroup.com/blog/2009/10/27/content-assist-did-not-complete-normally/ and http://www.airtightinteractive.com/2010/01/fix-for-flash-builder-content-assist-did-not-complete-normally/ . All of these pages say to close FB, delete the .metadata folder,restart FB, import/export some SWC file, and/or delete some file with "flexbuilder" in it's name. None of these work and I see nothing on my whole machine with any of "Flash Builder", "FB", "flex", or "flexbuilder" in it's name.
As a desperate last resort I deleted all traces of Eclipse, Android, Adobe anything, and Java from my machine.
Absolutely no difference what-so-ever. Besides exhaustion and heartache for me.
The content assist features seem to work fine in java files (for now anyway). It seems that only .xml files are affected.
What can I do to resolve or work around this issue?
Make sure the correct editor is opening the xml files. I have aptana and some other plugins that support xml files. Right click the file in project explorer and select open with, then select Android Xml Editor and see if you have completion.
I dont know if that is the exact name, because my eclipse just went south and wont even open :)
Right clicking the file and opening it specifically with Android Layout Editor is what solved the problem for me. Eclipse will continue to open it up with that editor after choosing that editor.
Uninstalling and re-installing the Android Developement Tools Plugin for eclipse at least partyl fixed the problem for me.
Strangely it worked best when completely uninstalling the plugin!?

Categories

Resources