0
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
etUsername = (TextView) (findViewById(R.id.etUsername));
etPassword = (TextView) (findViewById(R.id.etPassword));
tvRegister = (TextView) (findViewById(R.id.tvRegister));
blogin = (Button) (findViewById(R.id.blogin));
}
public void onClick(View v) {
Intent intent=new Intent(v.getContext(),Registeration.class);
startActivityForResult(intent, 0);
}
public void login(View view){
logid=etUsername.getText().toString();
logpass=etPassword.getText().toString();
String method="login";//my php script
BackgroundTask backgroundTask=new BackgroundTask(this);
backgroundTask.execute(method, logid, logpass);
Bundle bundle = getIntent().getExtras();
String message = bundle.getString("username");//Tried using intent
Menu mn=new Menu();
mn.textView9.setText(message);
}
Onpostexecute
if(result.contains("Login Successful")) // msg you get from success like "LoginSuccess"
{
MainActivity mm=new MainActivity();
Intent i = new Intent(ctx,Menu.class);
Menu mn=new Menu();
String username=mm.etUsername.getText().toString();
i.putExtra("username",username);
ctx.startActivity(i);
alertDialog.setMessage(result);
alertDialog.show();
}
活動我想在登錄的文本,顯示
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menu);
i1= (ImageView) (findViewById(R.id.i1));
etUsername=(EditText)(findViewById(R.id.etUsername));
textView9=(TextView)(findViewById(R.id.textView9));
}