java - Access Variable of Activity from BaseAdapter -


i want access variable activity in baseadapter class whom set listview of activity. error:

java.lang.nullpointerexception: attempt invoke virtual method 'java.lang.string java.lang.integer.tostring()' on null object reference 

these relevant parts of code:

public class getallentryslistviewadapter extends baseadapter {  integer markerid; pinboardactivity pinboard = new pinboardactivity();  public getallentryslistviewadapter(jsonarray jsonarray, context context) {     this.dataarray = jsonarray;     this.context= context;     //i want markerid variable pinboardactivity:     markerid = pinboard.markerid;     inflater = (layoutinflater)context.getsystemservice(context.layout_inflater_service); } //... public cursor getlikes(dbhelper dbh) {     //the following line 1 error occurs     string args[] = {markerid.tostring(), pos};     //... } 

that because markerid null.
check following line

//i want markerid variable pinboardactivity:     markerid = pinboard.markerid; 

here pinboard.markerid returning null object.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -