I made the method \"showResult\" static but i have problem with :
\"Toast.makeText(`getActivity()`.getApplication(), result2 + \"\\n\" + \"Total Amount:=\" + tot
the error explain itself you can not use getActivity() which is not static in static method
you can do the following scenario
define an Activity act;
initialize it in onCreateView
act =getActivity();
and in the your method :
Toast.makeText(act, result2 + "\n" + "Total Amount:=" + totalAmount2 + "€", Toast.LENGTH_LONG).show();