I have this strings array just with the purpose of testing a list view
<string-array name="prueba">
<item> calculo </item>
<item> fisica </item>
<item>logica</item>
<item>programacion</item>
<item> adsad</item>
<item>asdasdasdsad</item>
<item> trtr </item>
<item> yuuyu </item>
<item>ngngn</item>
<item>dgdg</item>
<item> liuj</item>
<item>kmbbm</item>
</string-array>
this is the listView code
public class Grades extends ListFragment implements AdapterView.OnItemClickListener {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.grades_fragment,container,false);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
ArrayAdapter adapter = ArrayAdapter.createFromResource(getActivity(), R.array.prueba, android.R.layout.simple_list_item_1);
setListAdapter(adapter);
getListView().setOnItemClickListener(this);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(getActivity(),"item" + position , Toast.LENGTH_SHORT).show();
}
}
So what I want is to instead of using that "test" array, using some strings that are located on my Parse.com Data, adding elements to the array when a string is added to the Data base in Parse.com
How can I do that?