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

Apps Make list View click with option

Duny

Lurker
Jun 6, 2010
2
0
I am fairly new to Java, I have created a listview that shows some topics, now I want a user to be able to click one of the topics and take them to a new intent. Here is what I have so far. I have played around and can not make the list view click.

Code:
package com.example.app;


import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Know extends iCorps {
    private String[] Topics;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.know);
        Topics = getResources().getStringArray(R.array.topics);
        //Arrays.sort(Countries);
        
        ListView list = (ListView)findViewById(R.id.list);
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.listitem, Topics);
        list.setAdapter(adapter);
}
    
    
}
 

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