How to assign textview return to a string?

Asked

Viewed 282 times

2

Well I am beginner in Android/Java, I wanted to do the following take the result of a textview that is caught through the scan Arcode and play in a string to make a list of results taken by the scan Arcode. How do I play the result in a string?

Follow the code excerpt:

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, Listview on the screen with item 1 and 2, I want it to be shown with the return of txResult.

Thank you.

  • Vitor, you don’t need to tag android-studio when your problem is not related to the IDE. See that one question

  • Okay, thanks for the tip.

1 answer

2


Browser other questions tagged

You are not signed in. Login or sign up in order to post.