android - Cannot resolve symbol 'ImageView2' -
i trying create imageview in fragment refer imageview element have created in xml fragment:
@override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { super.oncreateview(inflater, container, savedinstancestate); final view c = inflater.inflate(r.layout.activity_source, container, false); imageview view = (imageview) getview().findviewbyid(r.id.imageview3); view.setontouchlistener(this); return c; }
but although thought work cannot resolve 'imageview3'
instead of
(imageview) getview().findviewbyid(r.id.imageview3);
use
(imageview) c.findviewbyid(r.id.imageview3);
Comments
Post a Comment