Search code examples
javaandroideclipsemain-activity

Eclipse: Issues with deleting and creating projects


I am having an issue in Eclipse. If I create a project, then delete it and check the "Delete project contents on disk (cannot be undone)" check box, a project created afterwards with the exact same name and settings will not be created with a MainActivity.java file.

If I create a project then delete it without checking that box, it can be recreated with the MainActivity.java file but will require you to open and save the fragment_main XML file before the project can be deleted again (with or without checking the check box).

What is happening here? Why does it behave in this way?


Solution

  • @Zach H When deleting a project give you two options(The dialog box will ask your confirmation for deleting from workspace or not)

    1. Simple Delete
    2. Delete from workspace

    Under simple delete- As you delete a project then the project gets deleted in the Package Explorer but is still present in your workspace directory (i.e. the path where your projects are stored) because you didn't select delete from workspace option.

    Under Delete from workspace- When you confirm the option delete from workspace then you project gets deleted from your hard disk as well.

    When you simply choose delete then you can create a same project with same activity because the project with same name is not there in the package explorer. Only if the same project already exists then you will get an error asking you to rename your project.

    The above said problem happens only when you have not installed the ADT/Eclipse properly(missing some files from the SDK Manager).

    My suggestion for you is that you first install all the packages from the tools because a missing support tool could coz such problem as above