You first need to determine which variable is null, so use the debugger or proceed like so :
public int yourFunction(){
Intent bank_Amount_Intent = getIntent();
if (bank_Amount_Intent == null) {
System.out.println("bank_Amount_Intent is null");
return -1; //error #1
}
Bundle bundle = bank_Amount_Intent.getExtras();
if (bundle == null) {
System.out.println("bundle is null");
return -2; //error #2
}
double buyin_Money = bundle.getDouble("buyin", 0);
total = buyin_Money; // assuming "total" also is a double
bank_Amount.setText(String.valueOf(currency_Format.format(buyin_Money)));
return 0; //no error
}
You can then see in your console, which value was null. You can also use the returned value to determine the error code of that function.
When you know which value was null, you can do of two things : evaluate whether you want to keep it null or not
If you agree to keep a null value in that method, you can use it to pop an error or whatever you may want to do with a null value
If you don't want a null value, you can create an instance of an object of the type you need. eg, if bundle
was null, you can to this : bundle = new Bundle();
. Or you can preferably check why this value is null in the first place and correct the error. It is possible that an other function returns null and you only get the NullPointerException further in the execution.