2012-06-26 61 views

回答

1

爲什麼不活動延伸Thread class。你可以實現Runnable在你Activity

public class AndroidRunnable extends Activity implements Runnable{ 

Thread myThread; 


    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 
    } 

    @Override 
protected void onResume() { 
// TODO Auto-generated method stub 
super.onResume(); 
} 

@Override 
protected void onPause() { 
// TODO Auto-generated method stub 
super.onPause(); 
} 

@Override 
public void run() { 
// TODO Auto-generated method stub 

} 


} 

請參見本例中爲創建飛濺屏幕活動使用線程:

Android tutorial: How to make a basic splash screen