Android 在我的设备上启动我自己的应用程序时出现黑屏

Android 在我的设备上启动我自己的应用程序时出现黑屏,android,apk,Android,Apk,我刚刚构建了我的第一个应用程序的apk。它在AVD模拟器中工作,但当我在Desire HD上安装它时,一旦启动应用程序,屏幕就会变黑。 这是一个非常简单的应用程序,当我在EditText中键入颜色并按下按钮时,它只会改变背景。 什么会导致黑屏问题?谢谢 protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac

我刚刚构建了我的第一个应用程序的apk。它在AVD模拟器中工作,但当我在Desire HD上安装它时,一旦启动应用程序,屏幕就会变黑。 这是一个非常简单的应用程序,当我在EditText中键入颜色并按下按钮时,它只会改变背景。 什么会导致黑屏问题?谢谢

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    final EditText colore = (EditText)this.findViewById(R.id.newcolor);
    Button conferma = (Button)this.findViewById(R.id.confirm);
    final RelativeLayout rl = (RelativeLayout)this.findViewById(R.id.lay);
    final TextView error = (TextView)this.findViewById(R.id.errore);

    OnClickListener l = new OnClickListener(){
        @Override
        public void onClick(View arg0){
            String s = colore.getText().toString();
            if (s.equals("Blu")){
                rl.setBackgroundColor(getResources().getColor(R.color.LightBlue));
                error.setText("");
            }else if(s.equals("Rosso")){
                rl.setBackgroundColor(getResources().getColor(R.color.IndianRed));
                error.setText("");
            }else if(s.equals("Verde")){
                rl.setBackgroundColor(getResources().getColor(R.color.LightGreen));
                error.setText("");
            }else if (s.equals("Bianco")){
                rl.setBackgroundColor(getResources().getColor(R.color.White));
                error.setText("");
            }else if (s.equals("Cacca")){
                rl.setBackground(getResources().getDrawable(R.drawable.cacca_rosa));
                error.setText("");
            }else{
                error.setText("Colore non disponibile, scegline uno dalla lista.");
            }
        }
    };
    conferma.setOnClickListener(l);
}

你为你的应用程序指定了一个主题吗?我刚刚在果冻豆手机(我的DHD有ICS)上试用过,效果很好。如何提高兼容性?为什么不先阅读有关如何设计应用程序外观的谷歌文档?请发布一些代码,这样我们就可以看到问题出在哪里了:show us activity_main.xml