最新版的android studio报错,是因为我们用他自动生成的命名方式setText和getText都会标红,如下图。 我们只需要改getText和setText的变量类型改为TextView就可以了