public View getView(int position, View convertview, ViewGroup parentview){
View listItemview=convertview;
if(listItemview==null) {listItemview = LayoutInflater.from(getContext()).inflate(R.layout.list_item, parentview, false); }
Books currentbook =getItem(position);
TextView titleTextView = listItemview.findViewById(R.id.bookName);
if (currentbook != null) {
titleTextView.setText(currentbook.getmTitle());
}
TextView pageTextView = listItemview.findViewById(pages);
if (currentbook != null) {
pageTextView.setText( currentbook.getmPageCount());
}
return listItemview;
Exception throwed at this line...titleTextView.setText(currentbook.getmTitle()); also attached the getmTitle method. this is a program where an url is taken and a JSONresponse from url is extracted and parsed and dispalyaed.
public Books(String vTitle, ArrayList<String> vAuthorName, int vPageCount, String vUrl)
{
mTitle=vTitle;
mAuthorName=vAuthorName;
mPageCount=vPageCount;
mUrl= vUrl;
}
public String getmTitle(){return mTitle; }
public ArrayList<String>getmAuthorName(){return mAuthorName;}
public int getmPageCount() { return mPageCount; }
public String getmUrl() { return mUrl;}
}