package com.navigation;
import android.R.string;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity1 extends Activity {
private EditText t;
private Button btn;
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_activity1);
t=(EditText)findViewById(R.id.editText1);
btn=(Button)findViewById(R.id.button1);
abc();
}
public void abc() {
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
String name=t.getText().toString();
Intent obj=new Intent(MainActivity1.this,MainActivity2.class);
obj.putExtra("i", name);
startActivity(obj);
}
});
}
}
import android.R.string;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity1 extends Activity {
private EditText t;
private Button btn;
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_activity1);
t=(EditText)findViewById(R.id.editText1);
btn=(Button)findViewById(R.id.button1);
abc();
}
public void abc() {
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
String name=t.getText().toString();
Intent obj=new Intent(MainActivity1.this,MainActivity2.class);
obj.putExtra("i", name);
startActivity(obj);
}
});
}
}
No comments:
Post a Comment