What's the difference between myClass.this and getBaseContext? When I put an AlertDialog in a different class and instantiate it, I can only get the dialog to show if I use myClass.this from the parent class. I thought getBaseContext() did the same thing but I guess not. What am I missing?
            Asked
            
        
        
            Active
            
        
            Viewed 1,457 times
        
    2 Answers
3
            I believe you should look here first: Diffinitive rules for using Android's getBaseContext, getApplicationContext or using an Activity's “this”
0
            
            
        "this" refers to what method you're in, and "getBaseContext/getApplicationContext" refers to the Activity you're in.
 
    
    
        Tsunaze
        
- 3,204
- 7
- 44
- 81
- 
                    2this refers to class/object you are in, not method. – woodshy Jun 11 '11 at 06:04
 
     
     
    