Skip to main content

public class main2 extends Activity{ final int[] button = {R.id.button1,R.id.button2,R.id.button3,R.id.button4,R.id.button5, R.id.button6,R.id.button7,R.id.button8,R.id.button9,R.id.button10}; Button[] bt = new Button[button.length]; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.sign); for(int i=0;i<button.length;i++){ final Context context = this; final int b = i; bt[b]= (Button) findViewById(button[b]); Typeface font = Typeface.createFromAsset(getAssets(), "Angkor.ttf"); bt[b].setTypeface(font); bt[b].setOnClickListener(new OnClickListener() {

public class main2 extends Activity{
    final int[] button = {R.id.button1,R.id.button2,R.id.button3,R.id.button4,R.id.button5,
            R.id.button6,R.id.button7,R.id.button8,R.id.button9,R.id.button10};
    Button[] bt = new Button[button.length];
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sign);
        for(int i=0;i<button.length;i++){
            final Context context = this;
            final int b = i;
            bt[b]= (Button) findViewById(button[b]);
            Typeface font = Typeface.createFromAsset(getAssets(), "Angkor.ttf");
            bt[b].setTypeface(font);
            bt[b].setOnClickListener(new OnClickListener() {
                
                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    Intent myIntent = new Intent(context,r1.class);
                    startActivity(myIntent);
                }
            });
        }
    }
}

}

public class main2 extends Activity{ final int[] button = {R.id.button1,R.id.button2,R.id.button3,R.id.button4,R.id.button5, R.id.button6,R.id.button7,R.id.button8,R.id.button9,R.id.button10}; Button[] bt = new Button[button.length]; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.sign); for(int i=0;i<button.length;i++){ final Context context = this; final int b = i; bt[b]= (Button) findViewById(button[b]); Typeface font = Typeface.createFromAsset(getAssets(), "Angkor.ttf"); bt[b].setTypeface(font); bt[b].setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent myIntent = new Intent(context,r1.class);
                startActivity(myIntent);
            }
        });
    }
}

}

public class main2 extends Activity{
    final int[] button = {R.id.button1,R.id.button2,R.id.button3,R.id.button4,R.id.button5,
            R.id.button6,R.id.button7,R.id.button8,R.id.button9,R.id.button10};
    Button[] bt = new Button[button.length];
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sign);
        for(int i=0;i<button.length;i++){
            final Context context = this;
            final int b = i;
            bt[b]= (Button) findViewById(button[b]);
            Typeface font = Typeface.createFromAsset(getAssets(), "Angkor.ttf");
            bt[b].setTypeface(font);
            bt[b].setOnClickListener(new OnClickListener() {
                
                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    Intent myIntent = new Intent(context,r1.class);
                    startActivity(myIntent);
                }
            });
        }
    }
}
Source Link

public class main2 extends Activity{ final int[] button = {R.id.button1,R.id.button2,R.id.button3,R.id.button4,R.id.button5, R.id.button6,R.id.button7,R.id.button8,R.id.button9,R.id.button10}; Button[] bt = new Button[button.length]; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.sign); for(int i=0;i<button.length;i++){ final Context context = this; final int b = i; bt[b]= (Button) findViewById(button[b]); Typeface font = Typeface.createFromAsset(getAssets(), "Angkor.ttf"); bt[b].setTypeface(font); bt[b].setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent myIntent = new Intent(context,r1.class);
                startActivity(myIntent);
            }
        });
    }
}

}

default