我正在使用以下代码,在5秒后自动从first
活动转到ListViewCheckboxes
活动,但它有以下错误:
public class first extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.firstlayout);
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
// TODO: Your application init goes here.
Intent mInHome = new Intent(first.this, InvoiceASAPTabActivity.class);
first.this.startActivity(mInHome);
first.this.finish();
}
}, 3000);
}
}
错误:(17,33)错误:处理程序是抽象的;无法实例化 错误:(21,57)错误:找不到符号类InvoiceASAPTabActivity 错误:(18,16)错误:找不到符号方法postDelayed(,int)
如果有人可以提供帮助,我真的很感激,谢谢!
答案 0 :(得分:0)
可能是因为您导入了
import java.util.logging.Handler;
而不是
import android.os.Handler;