tags:

views:

30

answers:

2

I have an error stating something like:

The method foo() is undefined for the type bar(){}

Eclipse tells me that after entering this code:

((application_variables) this.getApplication()).setSomeVariable("foo");

I'm not sure if this is the problem, but I have it located under....

public void onItemClick(AdapterView<?> parent, View view,int position, long id) {

I'm guessing it has a problem with "this." I'm still learning about Android so I'm going pretty basic. What do I need to fix?

+1  A: 

Yeah, if you are using an inner anonymous class, the problem could the this. Try this:

((application_variables) YourActivity.this.getApplication()).setSomeVariable("foo");
Cristian
Thanks!........
Jack Love
A: 

I met the same problem as yours, I think Cristian's answer may be correct

lee
Yep. Fixed the problem.
Jack Love