Bug-116 Make MainActivity can select different category.

You should explain more about this algorithm in comment. Other people may not understand.