I'm new to Android / Java, I wanted to do the following to get the result of a textview that is taken through the barcode scan and play in a string to make a list of results taken by the barcode scan. How do I play the result in a string?
Here is the snippet of code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
txResult = (TextView) findViewById(R.id.txResult);
String[] itens = new String[]{"Item 1", "Item 2"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,(itens));
In this way the Listview with item 1 and 2 will display on the screen, I want it to be shown with the return of txResult.
Thank you.