Postingan lainnya
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); } });
2 Jawaban:
coba ikutin ini gan: <a href='https://www.youtube.com/watch?v=3Zrwi3FFrC8 '>https://www.youtube.com/watch?v=3Zrwi3FFrC8 </a>
Coba download sketchware di playstore gan, bikin logikanya di sana aja gan. Trus ketik ulang kodenya di PC.