在调用窗口填写代码:
Intent mainIntent = new Intent();
mainIntent.setClass(LoginActivity.this,
MainActivity.class);
/** 传递参数开始 */
Bundle buddle = new Bundle(); // 传递参数
buddle.putString("username", strResult);
buddle.putString("pwd", editpwd.getText().toString());
mainIntent.putExtras(buddle);
/** 传递参数结束 */
selfLocation myApp;
myApp = (selfLocation) getApplication();
myApp.user = username.toString();
myApp.pwd = editpwd.toString();
在接受activity的create里面加入如下代码:
/** 获取参数开始 */
Bundle buddle = this.getIntent().getExtras();
textView1.setText(buddle.getString("username"));
/** 获取参数结束 */