it's my first question here. I searched all the way, tried a lot but couldn't get what I want to do. Here's the problem: I have an app that uses SoundPool to play sounds, just that. But there's a lot to load (>50) and it takes time to load one by one. take a look;
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_fragment_hue, container, false); DBSupport.setContext(getActivity()); lista = DBSupport.getListaHue();
sp = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);
final ArrayList<CharSequence> lista_string = new ArrayList<CharSequence>();
for (int i = 0; i < lista.size(); i++) {
Hue e = null;
e = lista.get(i);
e.setValor(sp.load(getActivity(), getResId(e.getNome_hue(), ListaHues.class), 1));
lista_string.add(lista.get(i).getDescricao());
}
And I want to make a thread or an Async to load it while I scroll through the ListView
Any advice?
PS: I'm a newbie, so sorry if the code is confuse.
Thanks!!