views:

101

answers:

2

I have this code:

public class Home extends Activity{

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
            //...
            //at some point I have
            s.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){

              @Override
              public void onProgressChanged(SeekBar seekBar, int progress,
                      boolean fromUser) {

                  ContextNotionLevel ctnl=new ContextNotionLevel(this);
// <-- how can I reference Home class here to replace **this**, which as it is points to OnSeekBarChangeListener
              }
    }
}
+3  A: 

You can use Home.this to refer to the Home object.

sepp2k
+5  A: 

You can try:

 ContextNotionLevel ctnl=new ContextNotionLevel(Home.this);
ccheneson