2

Consider this example.

public class myclass {

public void...
public int ...

    private class my_nested_class {
          Intent i = new Intent(this, List.class);
    }

}

I would like "this" to be myclass. How can I do that? "this.super"? But that doesn't work.

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
  • maybe you wanto to tag it also with android? –  Feb 15 '10 at 08:58
  • Every nested class has its own 'this'. What you mean is `how do I access the enclosing outer class instance' and its answered here: http://stackoverflow.com/questions/1816458/getting-hold-of-the-outer-class-object-from-the-inner-class-object – Jherico Feb 15 '10 at 09:10

1 Answers1

8

It's myclass.this.

By the way, class names start with a capital letter in Java, you should rename your class MyClass.

Jerome
  • 8,427
  • 2
  • 32
  • 41