android – 最多可以创建多少个工作线程?

在我的平板电脑应用程序中,我在一个活动中使用了彼此相邻的许多片段(一个类),在这个Fragment类中我有:

public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    getLoaderManager().initLoader(this.position, null, this);
}

public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    Uri uri = Uri.withAppendedPath(...)
    return new CursorLoader(getActivity(), uri, proj, null, null, "distance");
}

每个Fragment为CursorLoader启动一个新的工作线程.这规模到底有多远?

最佳答案 没有硬性限制.但是,如果您担心要启动的线程数,请使用AsyncTask,因为其doInBackground方法在后台线程池中运行.更多信息

> Max thread number for one application?
> http://developer.android.com/reference/android/os/AsyncTask.html
> http://developer.android.com/guide/topics/fundamentals/processes-and-threads.html

点赞