I made the method \"showResult\" static but i have problem with :
\"Toast.makeText(`getActivity()`.getApplication(), result2 + \"\\n\" + \"Total Amount:=\" + tot
Try using context instead of getActivity.getApplication()
context
getActivity.getApplication()
Declare context as:
private static Context context = null;
and then intialize it as:
context=getActivity();
and then Toast :
Toast
Toast.makeText(context, result2 + "\n" + "Total Amount:=" + totalAmount2 + "€", Toast.LENGTH_LONG).show();