-1
如果我有一個從onCreate方法這樣叫一個線程方法:Android覆蓋線程?
public class TestActivity extends Activity {
/** Called when the activity is first created. */
public ArrayList<Integer> num= new ArrayList<Integer>();
public int i=0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
for (i=0;i<5; i++)
{
threadmethod();
}
}
public void threadmethod()
{
new Thread(new Runnable() {
public void run() {
Log.w(this.getClass().getName(),"num"+num.get(i));
}
}).start();
}
我想知道,有多少線程將被創建1或5? 感謝您的幫助