新的AdapterVIEw.OnItemClickListener(){}类型必须实现继承的抽象方法AdapterVIEw.OnItemClickListener.onItemClick(AdapterVIEw,VIEw,int,long)
为什么我在尝试构建教程时收到此消息
package Fedail.Hello.Layout;import androID.app.Activity;import androID.os.Bundle;import androID.Widget.*;import androID.vIEw.VIEw;import androID.vIEw.VIEwGroup;import androID.Widget.AdapterVIEw.OnItemClickListener;public class Layout_Feras extends Activity { /** Called when the activity is first created. */ public voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVIEw(R.layout.main); GrIDVIEw grIDvIEw = (GrIDVIEw) findVIEwByID(R.ID.grIDvIEw); grIDvIEw.setAdapter(new ImageAdapter(this)); grIDvIEw.setonItemClickListener(new OnItemClickListener(){ public voID onItemClick(AdapterVIEw<?> parent, VIEw v, int position, Long ID){ Toast.makeText(Layout_Feras.this,"" + position, Toast.LENGTH_SHORT).show(); } } ); } }
解决方法:
改变这个:
public voID onItemClick(AdapterVIEw<?> parent, VIEw v, int position, Long ID)
对此:
public voID onItemClick(AdapterVIEw<?> parent, VIEw v, int position, long ID)
覆盖超级方法时,必须确保所有数据类型都与原始类型匹配.
总结以上是内存溢出为你收集整理的android – 类型新的AdapterView.OnItemClickListener(){}必须实现继承的抽象方法AdapterView.OnItemClickListener)全部内容,希望文章能够帮你解决android – 类型新的AdapterView.OnItemClickListener(){}必须实现继承的抽象方法AdapterView.OnItemClickListener)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)