
above is part of code from myclass.
I have class GetPhoto and as shown above code,
I uses GetPhoto class. Here is GetPhoto class code

when I running my project, I am getting null pointer exception from GetPhoto class line 24.
What I thought was
1. move empty intent to GetPhoto class getphoto method
2.then fill this intent by using GetPhoto class object.
I am not sure why intent is still empty even it uses class object’s intent
can anybody tell me what am I doing wrong?
Because of line number 22
you are setting the function’s intent variable with a call to getIntent() of Activity. Since this activity is not yet invoked with an intent you do not have one. COmment that code out and it will not give you that error.