How to use Toast when I cant use "this" as context
If the toast is located inside your activity class, you could use YourActiviy.this
where YourActivity
is the class name. If it's outside your class, you'll need to get your activity context (pass it in the constructor etc).
If you are in the inner Class then try this also
getApplicationContext()
You can use NameOfYourActivity.this
For example:
public class MyActivity extends Activity {
...
Toast.makeText(MyActivity.this, text, duration).show();