Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smart refactoring of file names in Eclipse + Android?

Is there any way to refactor the name of a class file as well as all the references to that name in the Android project?

For example, if I Refactor > Rename the file CustomerListFragment.java , the following reference in Android resource files still needs to be changed manually.

   <fragment android:name="my.package.CustomerListFragment"
    android:id="@+id/item_list"
    android:layout_width="400dp"
    android:layout_height="match_parent"
    />

I think Visual Studio does this kind of refactoring automatically, is there any equivalent in Eclipse(Android)?

like image 611
David Miler Avatar asked Oct 06 '22 10:10

David Miler


1 Answers

Yes and no, it's actually listed on their roadmap as: Better refactoring support

Believe it or not, the refactoring/renaming support has actually gotten better over the last couple of weeks. Until very recently, it was still making mistakes when replacing class names and package names in the Manifest file (whenever some Activity file name was being refactored/renamed). But lately, I haven't been getting these errors, and I'm very happy that this isn't a manual step I have to do anymore.

You can also check out their bug tracker at: http://b.android.com and star the issue if you really want to get notified when this exact test case gets taken care of.

like image 119
Stephan Branczyk Avatar answered Oct 10 '22 13:10

Stephan Branczyk