fix AlertType warning; simplize code
Merge pull request #3 from liaojinxing/master

fix AlertType warning; simplize code