Android Question Find References of Image-files added in the designer

Discussion in 'Android Questions' started by skrjabin, Aug 14, 2019 at 12:46 PM.

  1. skrjabin

    skrjabin Active Member Licensed User

    Can I see in the IDE, where a Image-file is used? In which bal-file? If I add a file in the designer and set it to the Image-File property of an ImageView, I can not search for the file in the source-code.

    The background: I removed an Image-file (that is not needed anymore) in the Files Manager. But the IDE seems to need it somewhere. I get error "file not found" when project exporting as zip. Searching for this file in the source code or "Find All References" returns no results.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    When do you get this error? What happens when you try to compile it?
     
  3. skrjabin

    skrjabin Active Member Licensed User

    Actually I got error "file not found" when trying "Export As Zip" (I saw that the Auto Backup failed and wanted to do it manually). Compiling was in this case without error.

    Yesterday I had the same issue (can't find an old Image-File that I removed before), when compiling in Release Mode (not in Debug Mode). In both cases it helped, to search this file in the Designer files (manually) and remove it also here. Today this file still was existing in the designer. Yesterday (this issue with Release Mode) it was not showing up there, but it helped to set the Image-Property to another file.

    Also for other reasons it could be very helpful, to find ressources not only in the source code, but also in the Designer files.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    The layout name will be shown in the error message in the next version.
     
  5. skrjabin

    skrjabin Active Member Licensed User

    Great!
    How behaves the IDE, when I add and remove an Image-File in the designer, that is also used in source code like LoadBitmap(File.DirAssets, "somefile.png")? Will the file remove completely? How can I remove it only in the bal file with designer, but keep it in the file manager?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Try it.

    When you add the file it will also be added to the main files tab.
    When you remove it from the designer you will be asked whether you want to move the file to the recycle bin. If you click Yes it will be removed from both places. Clicking on No will only remove it from the layout file.
     
    skrjabin likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice