我有两个活动,如Activity
甲和乙,我试图通过使用Bundle
和startActivity(intent)
从A到B两个不同的字符串。如何从android中的其他活动获取数据?
就像是:
Intent intent = new Intent(A.this, B.class);
Bundle bundle = new Bundle();
bundle.putString("vidoedetails", filedetails);
//bundle.putString("videoname", filename);
intent.putExtras(bundle);
//intent.putExtra("videofilename", filename);
//intent.putExtra("vidoefiledetails", filedetails);
startActivity(intent);
而在B类,我用两个TextView
s到seperately显示从A类的字符串。
就像是:
Intent i = getIntent();
Bundle extras = i.getExtras();
filedetails = extras.getString("videodetails");
filename = extras.getString("videoname");
问题是filedetils
得到印在B类而不是文件名。
任何解决方案?
花了我40秒来发现差异:S – Tanin 2011-11-18 08:49:44