So I'm simply trying to pass a string to another activity using intent.putExtra(name, value); but for some reason the activity receiving the intent is saying it's a null reference. I have no idea why, because I've basically just copied the exact same code from a different activity which is performing the same task correctly.
Here is my code:
and here is the code for where the intent is received:
here is the error msg: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
(java line 33 is line 8 in the code snippet i provided)
as I said earlier I am using basically the exact same code to perform this task in other activities and it's working fine. It's probably a very simple and stupid mistake but I'd be grateful if someone could point out why the error is occurring.
Maneesh Godbole wrote:The first step to debug this would be to confirm the value being set is actually not null. Have you tried checking what is the value at this point?
I just edited the code to give me log tags, here they are:
09-08 12:09:55.196 1362-1362/com.example.testing_load D/LOG: class com.example.testing_load.TierOneListView﹕ VALUE OF name IS: ENGINE
09-08 12:09:55.196 1362-1362/com.example.testing_load D/LOG: class com.example.testing_load.TierOneListView﹕ VALUE OF id IS: 3