Changed some code according to androidlibs