Issue Details (XML | Word | Printable)

Key: NBANDROID-18
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: David Zumbrunnen
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
nbandroid

NBandroid arbitrarily overwrites AndroidManifest.xml

Created: 04/Mar/09 07:28 PM   Updated: 27/Jul/09 06:23 AM   Resolved: 27/Jul/09 06:23 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 0.9

Time Tracking:
Original Estimate: 2 hours
Original Estimate - 2 hours
Remaining Estimate: 2 hours
Remaining Estimate - 2 hours
Time Spent: Not Specified
Time Spent - Not Specified

Environment:

NetBeans 6.5, Kubuntu Linux amd64, NBandroid 0.2


Tags: xml manifest


 Description  « Hide

The manifest "AndroidManifest.xml" gets overwritten by default values now and then. For example when I use NetBeans' refactoring functionality. I realized it also when I restarted the IDE. Values like "android:label" or "android:name" are dropped out.



marigan added a comment - 14/Jul/09 01:19 PM

Vote for this. When you change sdk for project the AndroidManifest.xml is rewritten.


radim added a comment - 15/Jul/09 02:19 AM

Call to AndroidProjectUtil.updateAndroidManifest(project, pkgName, className) in
http://kenai.com/projects/nbandroid/sources/mercurial/content/project/src/org/netbeans/modules/android/project/ui/customizer/AndroidProjectProperties.java is the root of this problem.

Contributions welcomed. This does not look too difficult to fix.


radim added a comment - 17/Jul/09 06:51 AM

two use cases:
1. main activity class is refactored and AM.xml needs to be updated
2. user changes main activity in project properties

(2.) is wrong IMO. Project configuration should offer you to run default main activity and then this is not an issue. Or you may want to run some specific one but then it does not need to be synced with AM.xml content.

Using XPath like
string(manifest/@package)
string(manifest/application/activity/intent-filter/action[@android:name='android.intent.action.MAIN']//following-sibling::category[@android:name='android.intent.category.LAUNCHER']/parent::/parent::/@android:name)
we can get these names in Ant script and launch the activity.


radim added a comment - 27/Jul/09 06:23 AM

will be fixed in next update.