In class socialNetworksActivity
i have a method:
public void getResultFromFBPost(String result)
{
if (result.equals("SUC"))
ShowToast("Your message have been posted successfully", Toast.LENGTH_LONG);
else
ShowToast("There was an error posting,"
+ " please check your Internt connection", Toast.LENGTH_LONG);
}
Which calls this method (also in class socialNetworksActivity):
public void ShowToast(String message, int duration)
{
LayoutInflater inflater = getLayoutInflater();
....
}
When I call this method from inside the class it works fine.
But when I call this method from class B like this:
@Override
protected void onPostExecute(String result)
{
socialNetworksActivity.getResultFromFBPost(result);
pd.dismiss();
}
I get a NullPointerException
when code get to:
LayoutInflater inflater = getLayoutInflater();
Any idea why?