java - LinearLayout cannot be cast to a class I've created -



java - LinearLayout cannot be cast to a class I've created -

my exception: caused by: java.lang.classcastexception: android.widget.linearlayout cannot cast dismo.ufrj.br.bradmobile.headerclass

i've created class, headerclass, extends linearlayout. cant seem cast right way.(header linearlayout)

here's code

headerclass = (headerclass) findviewbyid(r.id.header);

the problem stated in error message: layout contains linearlayout, , effort cast own class. can't that. instead, need alter xml read:

<dismo.ufrj.br.bradmobile.headerclass .... .... .... > .... </dismo.ufrj.br.bradmobile.headerclass>

inheritance doesn't matter much here, since headerclass extends linearlayout, cast above xml linearlayout in code.

java android android-layout android-linearlayout

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -