Android splash Activity未实现或扩展Thread Class

时间:2012-06-26 18:54:08

标签: android

启动屏幕活动适用于线程类,但它不会扩展或实现Thread。那么Thread如何在Activity中工作?

1 个答案:

答案 0 :(得分: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