How to get the value of TextViews from an ArrayAdapter to another Class <p>In order to pass data from my Custom Adapter to another class I tried these two methods and none worked for me.</p> <pre><code> String SGetNumVol=Num_Vol.getText().toString(); String SGetComment=Commentaire.getText().toString(); String SGetAirpDepart=Aeroport.getText().toString(); String SGetDestination=Destination.getText().toString(); String SGetCompanie=code_Compagnie.getText().toString(); Intent intent =new Intent(c,DetailVol.class); Bundle bundle = intent.getExtras(); GetNumVol= bundle.getString(SGetNumVol); GetComment= bundle.getString(SGetComment); GetAirpDepart= bundle.getString(SGetAirpDepart); GetDestination= bundle.getString(SGetDestination); GetCompanie= bundle.getString(SGetCompanie); </code></pre> <p>and recieving it like</p> <pre><code> Intent i = getIntent(); Bundle b = i.getExtras(); if(b!=null) { String a =(String) b.get(CustomAdapter.GetAirpDepart); Airportdep.setText(a); String c =(String) b.get(CustomAdapter.GetDestination); dest.setText(c); String e =(String) b.get(CustomAdapter.GetNumVol); Num.setText(e); String f=(String) b.get(CustomAdapter.GetComment); com.setText(f); String j =(String) b.get(CustomAdapter.GetCompanie); Comp.setText(j); } </code></pre> <p>Second Method is like :</p> <pre><code> //SecondTest Intent i = new Intent(c, DetailVol.class); String SGetNumVol=Num_Vol.getText().toString(); String SGetComment=Commentaire.getText().toString(); String SGetAirpDepart=Aeroport.getText().toString(); String SGetDestination=Destination.getText().toString(); String SGetCompanie=code_Compagnie.getText().toString(); i.putExtra("SGetNumVol", SGetNumVol); i.putExtra("SGetComment", SGetComment); i.putExtra("SGetAirpDepart",SGetAirpDepart); i.putExtra("SGetDestination",SGetDestination); i.putExtra("SGetCompanie", SGetCompanie); </code></pre> <p>recieving : </p> <pre><code> //SecondTest if (savedInstanceState == null) { Bundle extras = getIntent().getExtras(); if(extras == null) { NumVol= null; Comment= null; AirDepart= null; Destination= null; Companie= null; } else { NumVol= extras.getString("SGetNumVol"); Comment= extras.getString("SGetComment"); AirDepart= extras.getString("SGetAirpDepart"); Destination= extras.getString("SGetDestination"); Companie= extras.getString("SGetCompanie"); } } else { NumVol= (String) savedInstanceState.getSerializable("SGetNumVol"); Comment= (String) savedInstanceState.getSerializable("SGetComment"); AirDepart= (String) savedInstanceState.getSerializable("SGetAirpDepart"); Destination= (String) savedInstanceState.getSerializable("SGetDestination"); Companie= (String) savedInstanceState.getSerializable("SGetCompanie"); } </code></pre> <p>The first returning NullPointerException and the second just pass without any error but it doesn't return values from Custom Adapter. I hope I explained it well, does anybody know how can I correct this? </p>