Hi, Try with
Intent intent = new Intent(arg); ... intent.putExtra("username", userNameValue); startActivity(intent); Then on next activity use String userNameValue = getIntent().getStringExtra("username"); Amir Alagic Sony Ericsson Mobile Communications The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of Sony Ericsson Mobile Communications AB On Aug 28, 12:21 pm, ragavendran s <sraghav.ra...@gmail.com> wrote: > How can i transfer username to next page by the Intent: > > package add.sam1; > > import android.app.Activity; > import android.app.AlertDialog; > import android.app.Dialog; > import android.content.Intent; > import android.os.Bundle; > import android.view.View; > import android.view.View.OnClickListener; > import android.widget.Button; > import android.widget.EditText; > > public class user extends Activity { > /** Called when the activity is first created. */ > > EditText username,pass; > Button enter; > public static String str1; > �...@override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > > username=(EditText)findViewById(R.id.username); > pass=(EditText)findViewById(R.id.pass); > enter=(Button)findViewById(R.id.enter); > > enter.setOnClickListener(new OnClickListener() { > public void onClick(View v) { > > str1=username.getText().toString(); > String str2=pass.getText().toString(); > > if(str1.equals("raghav") && str2.equals("123")) > { > > showint(); > > } > > else > { > Dialog locationError = new AlertDialog.Builder( > user.this).setIcon(0).setTitle( > "Error").setPositiveButton("ok", null) > .setMessage( > "Sorry, your u r not a Valid User") > .create(); > locationError.show(); > username.setText(""); > pass.setText(""); > } > > } > > }); > > } > > public void showint( ) > { > Intent intent = new Intent(this,welcome.class); > > startActivity(intent); > > > > } > }- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---