I have MyClass mc=new MyClass();, I need an access to subclass: mc.Sub.Check().
https://stackoverflow.com/a/488749/1234275 – doesn’t work in this case.
public class MyClass {
public onCreate() {
super();
}
Public class Sub {
public void Check() {
//
}
}
}
You just have to create the Object of the Inner class like normal class. In above case you can do by following.
Sub sub = new Sub();
sub.check();
put above code Inside the onCreate();
Hope this will help you.