SHARE
TWEET

Untitled

a guest Apr 22nd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. new AsyncTask<Void, Void, ArrayList<Barang>>() {
  2.             //didalam doInBackground tidak boleh akses tampilan
  3.             @Override
  4.             protected ArrayList<Barang> doInBackground(Void... voids) {
  5.                 ArrayList<Barang> hasil = new ArrayList<>();
  6.                 hasil.addAll(Arrays.asList(db.barangDAO().selectAllBarangs()));
  7.                 return hasil;
  8.             }
  9.  
  10.             @Override
  11.             protected void onPostExecute(ArrayList<Barang> barangs) {
  12.                 arrid.clear();
  13.                 for(Barang b : barangs){
  14.                     arrid.add(String.valueOf(b.getId_barang()) + " - " + String.valueOf(b.getNama_barang()));
  15.                 }
  16.                 spinadapter.notifyDataSetChanged();
  17.             }
  18.         }.execute();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top