Saturday, April 27, 2013

[android help] Thread doesn't start on Android


I have this piece of code into a ListFragment



@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
aa = new ArrayAdapter(getActivity(), android.R.layout.simple_list_item_1, postTitleList);
setListAdapter(aa);

Thread syncThread = new Thread(new Runnable(){
public void run()
{
syncPosts();
}
});
syncThread.start();

Log.d("POSTS", "Thread Status: " + syncThread.getState().toString());
Log.d("POSTS", "Thread ID: " + Long.toString(syncThread.getId()));
}


but unfortunately the Thread never starts, it remains in WAITING status, is there a way to force it running?



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...