0

我在 Galaxy S3 设备上测试我的应用程序时遇到问题。我创建了 apk 文件并将其放入 Galaxy S2 并且它可以工作,但是当我将我的应用程序放入 Galaxy S3 时,我收到此错误:

解决 0x00000000 处的致命信号 11(SIGSEV)

这是活动的代码:

public class Livello extends Activity {
    private TextView live;
    private TextView motto;
    private TextView punteggio;
    private int score=0;
    @Override


protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_livello);
            int i=getIntent().getExtras().getInt("livello");
            int livello=0;  


    RelativeLayout rel=(RelativeLayout)findViewById(R.id.provaLayout);
            rel.setBackgroundResource(R.drawable.marrone);
            Typeface myTypeface = Typeface.createFromAsset(this.getAssets(),"chu.otf");   


        switch (i) {
        case 1:
            live=(TextView)findViewById(R.id.livello);
            motto=(TextView)findViewById(R.id.motto);
            punteggio=(TextView)findViewById(R.id.punteggio);
            live.setText("LIVELLO 1");
            live.setTextColor(Color.YELLOW);
            live.setTypeface(myTypeface);
            live.refreshDrawableState();
            motto.setText(R.string.mottoLivello1);
            motto.setTextColor(Color.YELLOW);
            motto.setTypeface(myTypeface);
            motto.refreshDrawableState();
            punteggio.setText("PUNTEGGIO: "+0);
            punteggio.setTextColor(Color.YELLOW);
            punteggio.setTypeface(myTypeface);
            punteggio.refreshDrawableState();
            livello=1;
            new PassaActivity().execute(livello);
            break;
        case 2:
            live=(TextView)findViewById(R.id.livello);
            motto=(TextView)findViewById(R.id.motto);
            punteggio=(TextView)findViewById(R.id.punteggio);
            score=getIntent().getExtras().getInt("punteggio");
            live.setText("LIVELLO 2");
            live.setTextColor(Color.YELLOW);
            live.setTypeface(myTypeface);
            live.refreshDrawableState();
            motto.setText(R.string.mottoLivello2);
            motto.setTextColor(Color.YELLOW);
            motto.setTypeface(myTypeface);
            motto.refreshDrawableState();
            punteggio.setText("PUNTEGGIO: "+score);
            punteggio.setTextColor(Color.YELLOW);
            punteggio.setTypeface(myTypeface);
            punteggio.refreshDrawableState();
            livello=2;
            new PassaActivity().execute(livello);
            break;
        case 3:
            score=getIntent().getExtras().getInt("punteggio");
            live=(TextView)findViewById(R.id.livello);
            motto=(TextView)findViewById(R.id.motto);
            punteggio=(TextView)findViewById(R.id.punteggio);
            score=getIntent().getExtras().getInt("punteggio");
            live.setText("LIVELLO 3");
            live.setTextColor(Color.YELLOW);
            live.setTypeface(myTypeface);
            live.refreshDrawableState();
            motto.setText(R.string.mottoLivello3);
            motto.setTextColor(Color.YELLOW);
            motto.setTypeface(myTypeface);
            motto.refreshDrawableState();
            punteggio.setText("PUNTEGGIO: "+score);
            punteggio.setTextColor(Color.YELLOW);
            punteggio.setTypeface(myTypeface);
            punteggio.refreshDrawableState();
            livello=3;
            new PassaActivity().execute(livello);
            break;
        case 4:

            score=getIntent().getExtras().getInt("punteggio");
            live=(TextView)findViewById(R.id.livello);
            motto=(TextView)findViewById(R.id.motto);
            punteggio=(TextView)findViewById(R.id.punteggio);
            score=getIntent().getExtras().getInt("punteggio");
            live.setText("LIVELLO 4");
            live.setTextColor(Color.YELLOW);
            live.setTypeface(myTypeface);
            live.refreshDrawableState();
            motto.setText(R.string.mottoLivello4);
            motto.setTextColor(Color.YELLOW);
            motto.setTypeface(myTypeface);
            motto.refreshDrawableState();
            punteggio.setText("PUNTEGGIO: "+score);
            punteggio.setTextColor(Color.YELLOW);
            punteggio.setTypeface(myTypeface);
            punteggio.refreshDrawableState();
            livello=4;
            new PassaActivity().execute(livello);
            break;
        case 5:

            score=getIntent().getExtras().getInt("punteggio");
            live=(TextView)findViewById(R.id.livello);
            motto=(TextView)findViewById(R.id.motto);
            punteggio=(TextView)findViewById(R.id.punteggio);
            score=getIntent().getExtras().getInt("punteggio");
            live.setText("LIVELLO 5");
            live.setTextColor(Color.YELLOW);
            live.setTypeface(myTypeface);
            live.refreshDrawableState();
            motto.setText(R.string.mottoLivello5);
            motto.setTextColor(Color.YELLOW);
            motto.setTypeface(myTypeface);
            motto.refreshDrawableState();
            punteggio.setText("PUNTEGGIO: "+score);
            punteggio.setTextColor(Color.YELLOW);
            punteggio.setTypeface(myTypeface);
            punteggio.refreshDrawableState();
            livello=5;
            new PassaActivity().execute(livello);
            break;
        case 6:

            score=getIntent().getExtras().getInt("punteggio");
            live=(TextView)findViewById(R.id.livello);
            motto=(TextView)findViewById(R.id.motto);
            punteggio=(TextView)findViewById(R.id.punteggio);
            score=getIntent().getExtras().getInt("punteggio");
            live.setText("LIVELLO 6");
            live.setTextColor(Color.YELLOW);
            live.setTypeface(myTypeface);
            live.refreshDrawableState();
            motto.setText(R.string.mottoLivello6);
            motto.setTextColor(Color.YELLOW);
            motto.setTypeface(myTypeface);
            motto.refreshDrawableState();
            punteggio.setText("PUNTEGGIO: "+score);
            punteggio.setTextColor(Color.YELLOW);
            punteggio.setTypeface(myTypeface);
            punteggio.refreshDrawableState();
            score=getIntent().getExtras().getInt("punteggio");
            livello=6;
            new PassaActivity().execute(livello);
            break;
        case 7:

            score=getIntent().getExtras().getInt("punteggio");
            live=(TextView)findViewById(R.id.livello);
            motto=(TextView)findViewById(R.id.motto);
            punteggio=(TextView)findViewById(R.id.punteggio);
            score=getIntent().getExtras().getInt("punteggio");
            live.setText("LIVELLO 7");
            live.setTextColor(Color.YELLOW);
            live.setTypeface(myTypeface);
            live.refreshDrawableState();
            motto.setText(R.string.mottoLivello7);
            motto.setTextColor(Color.YELLOW);
            motto.setTypeface(myTypeface);
            motto.refreshDrawableState();
            punteggio.setText("PUNTEGGIO: "+score);
            punteggio.setTextColor(Color.YELLOW);
            punteggio.setTypeface(myTypeface);
            punteggio.refreshDrawableState();
            livello=7;
            new PassaActivity().execute(livello);
            break;
        case 8:

            score=getIntent().getExtras().getInt("punteggio");
            live=(TextView)findViewById(R.id.livello);
            motto=(TextView)findViewById(R.id.motto);
            punteggio=(TextView)findViewById(R.id.punteggio);
            score=getIntent().getExtras().getInt("punteggio");
            live.setText("LIVELLO 8");
            live.setTextColor(Color.YELLOW);
            live.setTypeface(myTypeface);
            live.refreshDrawableState();
            motto.setText(R.string.mottoLivello8);
            motto.setTextColor(Color.YELLOW);
            motto.setTypeface(myTypeface);
            motto.refreshDrawableState();
            punteggio.setText("PUNTEGGIO: "+score);
            punteggio.setTextColor(Color.YELLOW);
            punteggio.setTypeface(myTypeface);
            punteggio.refreshDrawableState();
            livello=8;
            new PassaActivity().execute(livello);
            break;
        }
    }

    class PassaActivity extends AsyncTask<Integer, Void, Void>{
        Intent i=null;

        @Override
        protected Void doInBackground(Integer... params) {
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            //Codice corretto per l'applicazione ma per muovermi devo evitare queste cose
//          i=new Intent(getApplicationContext(),Gioca.class);
//          i.putExtra("livello",params[0]);
//          i.putExtra("punteggio",score);
//          Log.i("valore",String.valueOf(params[0]));
//          startActivity(i);

//          //Codice per andare più veloce tra attività
            i=new Intent(getApplicationContext(),Punteggio.class);
            i.putExtra("livello",params[0]);
            i.putExtra("punteggio",2000);
            Log.i("valore",String.valueOf(params[0]));
            startActivity(i);

            return null;

        }

        public Void onPosteExecture(Void v){

            overridePendingTransition(R.anim.slide_in,R.anim.slide_on);
            return v;
        }




    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.livello, menu);
        return true;
    }

}

和xml代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/provaLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="bottom"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".Livello" >

    <RelativeLayout
        android:id="@+id/relativoUno"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/livello"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="Livello"
            android:textSize="50sp" />

    </RelativeLayout>

    <TextView
        android:id="@+id/motto"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/relativoUno"
        android:layout_below="@+id/relativoUno"
        android:layout_marginTop="38dp"
        android:gravity="center"
        android:text="TextView"
        android:textSize="25sp" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/motto"
        android:gravity="center" >

        <TextView
            android:id="@+id/punteggio"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="TextView"
            android:textSize="25dp" />

    </RelativeLayout>

</RelativeLayout>

任何人都可以帮助我吗?错误出现在:rel.setBackgroundResource(R.drawable.marrone);

4

0 回答 0