在第1页的作品旁边,第2页没有

时间:2017-07-28 15:30:01

标签: android

因为我的第一页和第二页OnClick有相同的事情,我试图复制和粘贴,但它不起作用。每当第二页Onclick到下一页时,它就会崩溃。我该怎么办?

第1页 - hira1_1> hira1_2> hira1_3运作良好

package com.linguido;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class bc_hira1_1 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bc_hira1_1);
    }

    public void toHira1_2(View view) {
        Intent intent = new Intent(this, bc_hira1_2.class);
        startActivity(intent);

    }
}
package com.linguido;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class bc_hira1_2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bc_hira1_2);
    }

    public void toHira1_3(View view) {
        Intent intent = new Intent(this, bc_hira1_3.class);
        startActivity(intent);
    }

}

第2页 - hira2_1> hira2_2> hira2_3在hira2_1>崩溃hira2_2

package com.linguido;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

public class bc_hira2_1 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bc_hira2_1);
    }

    public void toHira2_2(View view) {
        Intent intent = new Intent(this, bc_hira2_2.class);
        startActivity(intent);

    }
}
package com.linguido;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class bc_hira2_2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bc_hira2_2);
    }

    public void toHira2_3(View view) {
        Intent intent = new Intent(this, bc_hira2_3.class);
        startActivity(intent);
    }

}

0 个答案:

没有答案