The button that i have used is not responding to the click event, i have added the onClickListener. i am new to android , plz tell me where am i going wrong.
public class Welcome extends Activity implements OnClickListener{ EditText range; Button submit; /** Called when the activity is first created. */ public void onCreate(Bundle savedInstanceState) { Log.i("MyActivity", "Entered "); try { super.onCreate(savedInstanceState); setContentView(R.layout.main2); Button submit = (Button)findViewById(R.id.BtnSubmit); EditText range= (EditText)findViewById(R.id.EditRange); TextView title=(TextView)findViewById(R.id.txtTitle); TextView notice=(TextView)findViewById(R.id.txtRange); EditText EditRange = null; String value= EditRange.getText().toString(); final Bundle bundle= new Bundle(); bundle.putString("param1",value); submit.setOnClickListener((android.view.View.OnClickListener) this); } catch(Exception e) { //Log.d("My Activity",e.getMessage()); e.printStackTrace(); } } public void onClick(View v) { Log.i("MyActivity", "Entered OnClick()"); // TODO Auto-generated method stub String value= range.getText().toString(); final Bundle bundle= new Bundle(); bundle.putString("param1",value); Toast.makeText(getBaseContext(), "Wait", Toast.LENGTH_SHORT).show(); Intent myIntent = new Intent(v.getContext(), RoutePath.class); myIntent.putExtras(bundle); startActivity(myIntent); } }