嘿,谢谢大家的回答以及“跳过 48 帧!” 生病在这里发布错误
07-16 21:29:23.119: E/Trace(641): error opening trace file: No such file or directory (2)
07-16 21:29:23.309: D/dalvikvm(641): GC_FOR_ALLOC freed 73K, 3% free 8051K/8259K, paused 44ms, total 46ms
07-16 21:29:23.309: I/dalvikvm-heap(641): Grow heap (frag case) to 8.497MB for 614416-byte allocation
07-16 21:29:23.390: D/dalvikvm(641): GC_CONCURRENT freed 1K, 3% free 8650K/8903K, paused 33ms+16ms, total 79ms
07-16 21:29:23.709: I/Choreographer(641): Skipped 42 frames! The application may be doing too much work on its main thread.
07-16 21:29:23.770: D/gralloc_goldfish(641): Emulator without GPU emulation detected.
07-16 21:29:29.019: I/Choreographer(641): Skipped 48 frames! The application may be doing too much work on its main thread.
这是main.java
公共类主要扩展活动{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Thread logoTimer = new Thread(){
public void run(){
try{
sleep(5000);
Intent menuIntent = new Intent("com.kamath.thebasics.MENU");
startActivity(menuIntent);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally{
finish();
}
}
};
logoTimer.start();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
和 menu.java
公共类菜单扩展 Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
}
}