hi this is my helper class where i check internal connection and xml paersing and use this class to another activity the problem is when server connected is working fine b
Create a global variable like:
Context mContext;
Then add a constructor to your class, in which you accept a Context parameter and assign it to mContext like:
public AgAppHelperMethods(Context context) {
mContext = context;
}
Create an object in your Activity like:
AgAppHelperMethods helper = new AgAppHelperMethods(getBaseContext());
Finally, to show your Toast use:
Toast.makeText(mContext, "error server not responding " + e.getMessage(), Toast.LENGTH_LONG).show();