48

I am writing a new better version of my old Android project that will fix a lot of UI bugs but also has a better design, needed for integration of some new features.

As I go through the source I can see all my old and new TODOs in the source, but there are things I remember and forget I want to do in the future and don't fit in any source yet.

Eclipse had a simple list of Tasks in the project on which you could write down and track all bug fixes and new features you wanted for that project. Very handy!

Is there a way add such tasks/issues/notes/todos in Android Studio in the project in general, WITHOUT adding them at a specific place in the sources?

Zoe
  • 27,060
  • 21
  • 118
  • 148
RumburaK
  • 1,985
  • 1
  • 21
  • 30
  • http://stackoverflow.com/questions/23384804/how-to-see-all-todo-tasks-in-android-studio – pskink Mar 08 '15 at 12:08
  • no, I meant how to add new tasks or TODOs or notes for the project but NOT in the source – RumburaK Mar 08 '15 at 12:53
  • I'm coming from Eclipse, and I came across this post when I Googled exactly the same question. The answer appears to be "you can't". WORKAROUND: Make your AndroidStudio project a subdirectory in a Git project (or equivalent). Put your "Readme.md" (or equivalent) at the top level in the Git project, parallel to your AndroidStudio subdirectory. – paulsm4 Mar 26 '16 at 19:42
  • Seems to me you should mark C. Todd's answer below as the correct one (it works for me in the current version of Android Studio). – John Perry Jun 08 '17 at 07:42

13 Answers13

89

To add a ToDo, just comment anywhere in your code starting with the word ToDo

//Todo: Get count from database instead

To view the list of ToDos, look in the bottom left corner of your Android Studio window:

enter image description here

if you open it, you will get this view with the list of your todos and options to navigate to files where they are located in your project:

enter image description here

Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
  • 8
    As of v2.2.3 you can add TODO to an XML by typing: `` See the answer from @Wajid Ali below – Austin Jan 07 '17 at 08:33
24

go to View -> Tool Windows -> TODO to display the TODO panel

Anything marked

// TODO

should be visible in the list panel

Edit: You can add plugins for task management in Intellij 14

https://www.jetbrains.com/idea/help/managing-tasks-and-context.html

I've not used them as our workflow is outside the IDE and I can't comment on whether they will work as intended in Android Studio.

  • 1
    no, I meant how to add new tasks or TODOs or notes for the project but NOT in the source – RumburaK Mar 08 '15 at 12:52
  • 1
    There are plugins available to manage tasks and workflows but I've not added them. I've edited my answer with the link to the help page in Intellij for further information. – metalmonkeysoftware Mar 08 '15 at 22:03
15

Here's how I do this: I create a text file called "TaskList.txt". I put it in the java/res package. (Not necessarily appropriate for this package, but I haven't felt like creating a package just for this purpose.)

Like any code file, you can start a line with

//TODO

and the IDE will recognize it as one of your tasks. You can have dozens or hundreds of TODO's in this file. And, of course, you can still have TODO's embedded in your code files, closely-associated with the code you need to update/correct.

My TaskList.txt TODO's show up in Android Studio's TODO view (bottom-left corner of the IDE or View -> Tool Windows -> TODO) along with all my embedded TODO's.

C. Todd
  • 468
  • 1
  • 5
  • 11
  • You don't have to start with a comment, either, at least not in the current version. That is, I can get it to show up just typing `TODO` without the slashes. – John Perry Jun 08 '17 at 07:40
15

In order to set check points for yourself inside the android studio project, you may do it as:

In Java File:

// TODO: I am waiting for you to be fixed ;)

OR

//FIXME: fix me before release :)

In XML File:

<!-- TODO! Hey I am here down in XML -->

some one above commented that todo is not working inside xml file so it is for them. You can view them in your android studio window of TODOs: enter image description here

and all todos from your project will be listed like: enter image description here

Wajid
  • 2,235
  • 1
  • 19
  • 29
7

You can use either of TODO, FIXME, etc. but it's not possible to do that without using them inline in your code. use them as follow:

{
...
some code //FIXME
...
}

or

{
...
some code //TODO
...
}

Here's a cheat sheet for some popular IDEs:

  • IntelliJ IDEA-based IDEs (e.g. Android Studio): TODO, FIXME

  • Visual Studio: HACK, TODO, UNDONE and NOTE.

  • Eclipse: @todo, FIXME, TODO and XXX.

  • Netbeans: TODO and FIXME

  • Code::Blocks: At least TODO.

  • Rider: TODO and BUG

  • Android Studio: TODO and FIXME

P.S. feel free to edit this answer by adding your fav IDE comment tokens.

Kishita Variya
  • 810
  • 9
  • 19
Shayan Amani
  • 5,787
  • 1
  • 39
  • 40
3

Write (todo) after than press tab key

Hossein Hajizadeh
  • 1,357
  • 19
  • 10
3

According to this link, you can define all of your own comment tags (TODO, FIXME, OPTIMIZE, OPTIONAL, etc).

Android Studio -> Settings/Preferences -> Editor -> TODO

enter image description here

Red - Add your own patterns using the \bpattern\b* format

Green - Add custom filters. These filters show up in the filter list at the bottom of Android Studio on the TODO tab.

enter image description here

Code on the Rocks
  • 11,488
  • 3
  • 53
  • 61
1

EDIT better use Alternative to avoid app crash

Alternative: You could write it like this: //TODO: "your todo here", and it'll also appear on TODO tool windows

In Android Studio (I'm using v2020.3.1), you could do (... = your normal codes):

...
TODO("your todo here")
...

TODO comment example

TODO comment example alternative

It will show up on the TODO tool windows (View -> Tool Windows -> TODO)

Todo lists window

Todo lists alternative window

NOTE: It could cause your app to crash if your code read it as a function call (Error code/function not implemented yet)

yanottamao
  • 17
  • 4
0

In Android Studio under the Tools menu there is the option for Tasks&Contexts. You can manually add tasks (i.e the todo's you want to perform for your project). It is quite simple, just add a task title, a VCS branch name and changelist, so might not suit your needs. Follow this link to learn more.

KvdLingen
  • 1,230
  • 2
  • 14
  • 22
  • Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Bhargav Rao Nov 06 '16 at 08:11
  • Googling for a way to track issues directly from within Android Studio I found this question and the answer. Since I had not tested it at the moment I just provided the link. Also it feels like cheating just to copy someone's solution verbatim, even providing the link. – KvdLingen Nov 06 '16 at 08:39
0

My favorite way is like the following: <!-- //TODO: Poczytać o rodzaja Layoutow -->

0

//todo works as well for java in android studio. No need for capitalization.

0

This will make your ease

<!-- TODO: Update blank fragment layout -->
0

I found this plugin https://plugins.jetbrains.com/plugin/14966-todo4me

todo4me

You can keep track of local work without add a //todo comment. Sometimes as you said, you just need to keep track of small tasks and you don't want to use tools like jira.

YorchSircam
  • 168
  • 8