Problem: Implementing an abstract method of inheritance

Source: Internet
Author: User

This morning in the learning process, in the implementation of the abstract method of inheritance, obviously has been achieved, but still will error.

The code is as follows:

Package Com.example.listview;import Java.util.arraylist;import Java.util.list;import android.app.activity;import Android.os.bundle;import Android.util.log;import Android.view.menu;import Android.view.menuitem;import Android.view.view;import Android.widget.adapter;import Android.widget.adapterview;import Android.widget.adapterview.onitemclicklistener;import Android.widget.arrayadapter;import Android.widget.ListView Import Android.widget.toast;public class Mainactivity extends Activity {private list<picture> picturelist = new Ar Raylist<picture> (); @Overrideprotected void OnCreate (Bundle savedinstancestate) {super.oncreate ( Savedinstancestate); Setcontentview (R.layout.activity_main); Initpicture (); Pictureadapter adapter = new Pictureadapter (Mainactivity.this, R.layout.picture_item, picturelist); ListView ListView = (ListView) Findviewbyid (R.id.list_view); Listview.setadapter (adapter); Listview.setonitemclicklistener (New Onitemclicklistener () {@Overridepublic void Onitemclick (AdaptervIew<?> Parent, view view, int Position,long ID) {//TODO auto-generated method stubpicture picture = Picturelist.get (position); LOG.D ("Mainactivity", "You clicked:" +picture.getname ()); Toast.maketext (Mainactivity.this, "You clicked:" +picture.getname (), Toast.length_short). Show ();}}); private void Initpicture () {//TODO auto-generated method Stubpicture android = new picture ("Android", R.drawable.android) ;p Icturelist.add (Android); Picture Apple = new Picture ("Apple", R.drawable.apple);p Icturelist.add (Apple); Picture safemgr = new Picture ("Safemgr", R.drawable.guanjia);p Icturelist.add (safemgr); Picture Linux = new picture ("Linux", R.drawable.linux);p Icturelist.add (Linux); Picture VCR = new picture ("VCR", R.drawable.shexingji);p icturelist.add (VCR); Picture set = new Picture ("Set", R.drawable.shezhi);p Icturelist.add (set); Picture windows = new picture ("Windows", R.drawable.windows);p icturelist.add (Windows); Picture music = new Picture ("Music", R.drawable.yinyue);p Icturelist.add (music); Picture game = new Picture ("Game", R.drawable.youxi);p Icturelist.add (game); Picture camera = new picture ("Camera", R.drawable.zhaoxiangji);p icturelist.add (camera);}}

Error:

Abstract method Implementation:

  Error message:

  

  Really can not find errors, and then to the QQ group to ask, just know that the implementation of the abstract method needs to be added automatically, cannot copy or hand-hit. When I delete the code of my own hand, I do not report an error when I use the auto-add implementation. Asked why, no one answered me. Is this question too retarded?

Solving. Thank you

  

Problem: Implementing an abstract method of inheritance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.