Android trying to create a base class for the Activity classes and app crashes -


i thought need if had base class screens on android. not have retype in same stuff,....but crashes when replace activty cbase (my base class)

base class

public class cbase extends activity{    public void oncreate(bundle savedinstancestate) {    }  } 

my class crashes

public class tellafortuneactivity extends cbase implements onclicklistener { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.main);      // add add     // create adview     adview adview;     adview = new adview(this, adsize.banner, "a14e10cb6b18825");      // lookup linearlayout assuming it’s been given     // attribute android:id="@+id/mainlayout"     linearlayout layout = (linearlayout)findviewbyid(r.id.mainlayout);      // add adview     layout.addview(adview);      // initiate generic request load ad     adview.loadad(new adrequest());        // add listeners     view mabout = findviewbyid(r.id.bio);     mabout.setonclicklistener(this);      view mhistory = findviewbyid(r.id.history);     mhistory.setonclicklistener(this);      view myesno = findviewbyid(r.id.butyesno);     myesno.setonclicklistener(this);      view msocial = findviewbyid(r.id.socialgame);     msocial.setonclicklistener(this);      view mwheel = findviewbyid(r.id.wheelgame);     mwheel.setonclicklistener(this);      view mchat = findviewbyid(r.id.chat);     mchat.setonclicklistener(this);      view mtest = findviewbyid(r.id.test);     mtest.setonclicklistener(this);         }  public void onclick(view v) {     intent i;     switch(v.getid())     {      case r.id.bio:         // check data first              = new intent(this, cbio2.class);             startactivity(i);          break;      case r.id.history:             = new intent(this, chistory.class);             startactivity(i);         break;      case r.id.chat:          = new intent(this, cchat.class);         startactivity(i);         break;            case r.id.wheelgame:             = new intent(this,cyesnocarddeck.class);         startactivity(i);                    break;                        case r.id.socialgame:            = new intent(this,csocialgame.class);         startactivity(i);          break;                    case r.id.butyesno:          = new intent(this, cyesnodirections.class);         startactivity(i);          break;           case r.id.test:         = new intent(this, cyesnoshuffle.class);         startactivity(i);          break;            } // end else     } // end function } // end class 

in cbase should use @override oncreate(bundle savedinstancestate) method , must call through super.oncreate(bundle savedinstancestate)


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -