You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio:如何为只读文件添加个人注释?

How to Add Personal Notes to Read-Only Files in Android Studio

Hey there! Great question—dealing with read-only files (like SDK sources or third-party library code) and wanting to jot down personal notes without modifying the original is a super common pain point. Luckily, Android Studio has several built-in tools that let you do this perfectly:

1. Bookmarks with Custom Descriptions

This is my go-to for quick, line-specific notes:

  • Click the right margin next to the line number (or use the shortcut F11 for Windows/Linux, Fn+F11 for Mac) to add a bookmark.
  • Right-click the tiny bookmark icon that appears, select Edit Description, and type in your personal notes.
  • These notes are stored in Android Studio's local config—they never touch the original read-only file. You can view all bookmarks and their notes by pressing Shift+F11 to open the Bookmarks tool window, where you can even search through your notes.

2. External Annotations (For Library/SDK Files)

If you're working with read-only library code or Android SDK sources, this tool is tailored for you:

  • Right-click the code you want to annotate, then go to Analyze > External Annotations > Add Annotation.
  • Here you can add detailed comments, mark TODO items, or even add custom warnings/hints. All these annotations are saved in a separate local directory on your machine, so they don't alter the original read-only file at all.

3. Favorites with Notes

For marking entire code blocks or sections:

  • Select the code you want to note, right-click it, and choose Add to Favorites.
  • When naming your favorite, you can include your notes directly in the name, or right-click the favorite later to edit its details.
  • Access all your favorites (and their notes) via the Favorites tool window, opened with Alt+2 (Windows/Linux) or Cmd+2 (Mac).

All these methods keep your personal documentation completely isolated from the original file, so you never have to worry about messing with read-only permissions or breaking source code. Your notes will stick around between IDE sessions as long as you don't reset your Android Studio settings.

内容的提问来源于stack exchange,提问作者Lore

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 09:01:11