所以我刚刚注意到我的应用程序在模拟器中运行时跳过了很多帧。这是我的第一个应用程序,我对该主题进行了一些阅读,发现我可能没有正确启动活动。但是,我的活动是通过设置菜单加载的,我不知道它在我的代码中的什么位置。如果这是一个大问题,如果有人能指出我与我的特定代码相关的正确方向,我将不胜感激? https://github.com/addrum/Calculate
如果需要,我可以优先在此处发布代码。
编辑:它似乎跳过了启动活动的帧:
package com.main.androidcalculator;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class SplashActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread timer = new Thread() {
public void run() {
try{
sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
Intent openMain = new Intent("com.main.androidcalculator.MAINACTIVITY");
startActivity(openMain);
}
}
};
timer.start();
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
finish();
}
}