-->

How to add TODOs and track project issues in Andro

2019-02-07 19:53发布

问题:

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?

回答1:

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:

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:



回答2:

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.



回答3:

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.



回答4:

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:

and all todos from your project will be listed like:



回答5:

Write (todo) after than press tab key



回答6:

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.



回答7:

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



回答8:

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.