My main activity “My_Gallery” is calling a function from another class “DataCall”. In DataCall I am trying to Toast a variable to make sure I have the correct info in there.
Toast.makeText(DataCall.this, url_param_string, Toast.LENGTH_SHORT).show();
But I am getting the following error under DataCall.this
Cannot use this in a static context
Not sure what I am missing. Thanks in advance for any feedback.
Also I am new to Eclipse and I see in debug mode there is a window for variables but it is empty.
That’s exactly the error. You can’t call
thison a static context, like a static function.If you need a context for Toast. Try the application context:
Context.getApplicationContext()