如何对字符串数据使用putExtra()和getExtra()
getExtra()putExtra()
Intent i = new Intent(FirstScreen.this, SecondScreen.class); String keyIdentifer = null; i.putExtra(strName, keyIdentifer );
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.table);
TextView userName = (TextView)findViewById(R.id.userName);
Bundle bundle = getIntent().getExtras();
if(bundle.getString("strName")!= null)
{
//TODO here get the string stored in the string variable and do
// setText() on userName
}
}myEditText.getText().toString()
慕莱坞森
呼唤远方
相关分类