• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Help going from list view, to relevant text view.

deenybird

Lurker
Feb 4, 2009
3
0
I'm trying to figure out how to have the user presented with a 'list view' of several options, than by clicking on one of the items have it open up a text view on a new screen with the relevant text. The problem I'm having is passing the variable to another class.

It's my understanding that I need to use an intent to pass the variable but if thats the case, what is the point of making a public integer? I was under the impression "public" means any class can use that variable.

Here is the code I have so far

listview1.setOnItemSelectedListener(new OnItemSelectedListener() {

@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {

Intent.putExtra(someKey, ID)

}
}

I really appreciate any feedback provided.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones