I would like to know if it is possible to return my listDataHeader to a string, because in my system.out it returns the value, but I do not know how to pass it to a string ...
private void prepareListData() {
//
// final Intent intent = getIntent();
// String result = (String) intent.getSerializableExtra("result");
// listDataHeader = new ArrayList<String>();
listDataChild = new HashMap<String, List<String>>();
// Adding headers
Resources res = getResources();
String[] headers = res.getStringArray(R.array.nav_drawer_labels);
listDataHeader = Arrays.asList(headers);
Button btnaddlivro = (Button) findViewById(R.id.btnaddlivro);
btnaddlivro.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity2.this, Activity_addinf.class);
intent.putExtra("mId", id);
startActivity(intent);
}
});
List<String> home, friends, notifs;
String[] shome, sfriends, snotifs;
shome = res.getStringArray(R.array.Informatica);
home = Arrays.asList(shome);
sfriends = res.getStringArray(R.array.elements_Portugues);
friends = Arrays.asList(sfriends);
snotifs = res.getStringArray(R.array.elements_Matemática);
notifs = Arrays.asList(snotifs);
// Add to hashMap
listDataChild.put(listDataHeader.get(0), home); // Header, Child data
listDataChild.put(listDataHeader.get(1), friends);
listDataChild.put(listDataHeader.get(2), notifs);
System.out.println (listDataHeader.get(0));
}
>Gostaria de saber se é possivel pegar o que retorna no print ,para uma string