-1
I have a problem while passing a serializable class. I insert it into the Bundle as follows.
public void voltarMain(View view) {
Intent myIntent = new Intent(getApplicationContext(), MainActivity.class);
myIntent.putExtra("Cliente", cliente);
startActivity(myIntent);
finish();
}
When I try to receive it in the second Activity it is in the Bundle but gives me an error of "java.lang.Nullpointerexception: Attempt to invoke virtual method 'int java.math.Roundingmode.ordinal()' on a null Object Reference"
This is how I try to get it.
This is the error obtained
Note: On a tablet Huawei Mediapad T5 (android 8.0) works correctly while this error comes to me in Samsung A7 2018 (android 9.0)
Thanks for the tip of the code block. As for the solution presented I have also tried and with the same result :(
– Filipe Torres
Have you ever tried to put a breakpoint on startActivity to see if Intent has the extra you put in? It’s weird that it didn’t work because I always use it this way and I’ve never had a problem.
– Vitor Ramos
The strange thing is that on an android tablet 8 works perfectly and on an android phone 9 no longer da
– Filipe Torres