android - Passing "this" from Java Interface to another Class -


giving following class of android project :

preview extends surfaceview implements surfaceholder.callback 

and

a extends doc 

i don't know how ask , know not want preview, call abstract method of doc. in doc's method, have call method of previous object of preview.

this example :

from preview.java :

   doc _doc = new a();    private void mymethod() {        this._doc.process(this)    } 

from a.java :

@override public void process(preview p) {     p.processa(); } 

the problem got error :

the method process(preview) in type doc not applicable arguments (new camera.previewcallback(){})

however, can't change judging fact want call method preview. tried many thing such cast etc. none of them works.

thanks !

ps : on eclipse under windows.

assuming calling a.process(this) anonymous inner class (of type camera.previewcallback presume, hence error message), have write a.process(preview.this), since standalone this refers inner class , not preview instance.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -