我将这段代码放入 ListFragment
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
aa = new ArrayAdapter<String>(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()));
}
但不幸的是,线程永远不会启动,它仍然处于等待状态,有没有办法强制它运行?