Im making a project where the list items are contents with multiple attributes (username and passoword). I want to make the listview only display the usernames and once the username is clicked it would show the users password in a toast message. Im new to programming so i would need a few hints.
I managed to make the class and add 2 users to the array list.
Any ideas on how i could make the listview only display the usernames and then the password once the username is clicked?
Thanks in advance :)
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
static class user {
public String username;
public String password;
public user(String name, String pass) {
username = name;
password = pass;
List<user> userList = new ArrayList<>();
userList.add(new user("Tom", "Hello123"));
userList.add(new user("Jack", "Hell1"));
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…