请不要像我一样:
//初始化商品,价格和说明的构造函数 public ItemAdapter(Context,c,String [] i,String [] p,String [] d){ 项目= i; 价格= p; 说明= d; //初始化LayoutInflater mInflater =(LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
由于我无法在上下文中调用getSystemServices(),因此需要花费数天的时间才能弄清该错误。 值得庆幸的是,这里有一个Android设备,我可以在那里获得帮助并继续进行我的项目。 这是没有错误的代码:
//初始化商品,价格和说明的构造函数 public ItemAdapter(Context c,String [] i,String [] p,String [] d){ 项目= i; 价格= p; 说明= d; //初始化LayoutInflater mInflater =(LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Forget about forgetting semicolons, all it takes is a comma in Java or an apostrophe in xml to throw everything off. It's always the little things, the nuances. This project is still in development so check it out in a day or so to get the complete source code.
这个项目最有趣的是,我犯了最大的错误。 忘记在项目仍在运行时进行推送,然后中断它可能是有害的,并且会浪费大量时间。 今天的重要一课是永远记住要推动您的代码。 总是。 你不想伤心。
Also, if it weren't for Android Studio I would never have caught this error and just kept coding away. A big shout out to Damien Diehl the 一种ndroid Developer @ Twitch on Slack and Android Studio for keeping me moving. I was seconds from scrapping this project and he came to the rescue like a hero. I really like android development even over web development or data science. This might just be my neeche.