Friday, 1 June 2012


Example for main.java



package intentcalculator.i;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class IntentcalculatorActivity extends Activity implements OnClickListener{
    /** Called when the activity is first created. */

TextView wel;
Button cal;



    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
        wel=(TextView) findViewById(R.id.wel);
        cal=(Button) findViewById(R.id.cal);
       
        cal.setOnClickListener(this);
       
       
       
    }

public void onClick(View v) {
// TODO Auto-generated method stub
Intent i=new Intent(this,calc.class);
startActivity(i);

}
}

No comments:

Post a Comment