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 - Unable to make sub reports with Jasper -

Save and close a word document by giving a name in R -

scala - play framework: Modules were resolved with conflicting cross-version suffixes -