android studio shared preferences

sharedpreferences untuk listvivew dengan adapter checked text view, gimana ya agar ceklist terus saat di back :(

final String[] items = {"BAJU RENANG","KAOS", "CELANA", "PAKAIAN DALAM", "JILBAB", "TOPI", "SANDAL", "KACAMATA", "KACAMATA HITAM", "LEGGING","KAOS KAKI","TAS","HANDUK","SUNBLOCK", "SHAMPOO","SABUN","SIKAT GIGI", "HANDBODY","KANTONG PLASTIK","OBAT","MAKANAN","IKAT RAMBUT", "PAPAN SURFING", "KARTU IDENTITAS", "PASSPORT", "VISA", "ENTRY PERMIT", "EXIT PERMIT", "DOKUMEN KESEHATAN", "SIM", "BUKU", "CHARGER", "LAPTOP", "HEADSET", "MOUSE", "KAMERA", "HANDPHONE", "IPOD", "BATTERY", "SENTER","KABEL USB","POWERBANK","STOP KONTAK","JAM TANGAN" }; ArrayAdapter adapter = new ArrayAdapter(this, R.layout.rowlayout, R.id.txt_lan, items); chl.setAdapter(adapter); chl.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView adapterView, View view, int i, long l) { String selectedItem = ((TextView) view).getText().toString(); if (selectedItems.contains(selectedItem)) { selectedItems.remove(selectedItem); } else selectedItems.add(selectedItem); } });

avatar sarsept
@sarsept

2 Kontribusi 0 Poin

Diperbarui 6 tahun yang lalu

2 Jawaban:

coba ikutin ini gan: <a href='https://www.youtube.com/watch?v=3Zrwi3FFrC8 '>https://www.youtube.com/watch?v=3Zrwi3FFrC8 </a>

avatar keccikun
@keccikun

368 Kontribusi 197 Poin

Dipost 6 tahun yang lalu

Coba download sketchware di playstore gan, bikin logikanya di sana aja gan. Trus ketik ulang kodenya di PC.

avatar Adinur
@Adinur

63 Kontribusi 8 Poin

Dipost 6 tahun yang lalu

Login untuk ikut Jawaban