Now I am getting null pointer Exception here. In, ViewAllData method myAdapter = new SQLCustomViewAllDataAdapter(SQLViewAllData.this,aList);
here I am getting Error on creating the Constructor.
SQLViewAllData.java
public class SQLViewAllData extends Activity {
private SQLDbHelper myDbHelper;
private SQLCustomViewAllDataAdapter myAdapter;
private ListView myListView;
private ArrayList<SQLPojo.UserDetails> aList = new ArrayList<>();
//private Context myContext;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listview_view_data);
//myContext = this;
widgetInitialization();
viewAllData();
}
//Initializing Widgets
public void widgetInitialization() {
myDbHelper = new SQLDbHelper( this );
myListView = (ListView)findViewById( R.id.listview_view_data_LV );
}
public ArrayList<SQLPojo.UserDetails> getUserInfo(){
return myDbHelper.getUserDetails();
}
//view all data stored in DB
public void viewAllData() {
aList = getUserInfo();
myAdapter = new SQLCustomViewAllDataAdapter(SQLViewAllData.this,aList);
myListView.setAdapter(myAdapter);
}
}