我有两个活动,如活动
A和B,我试图通过两个不同的字符串从A使用捆绑和
startActivity(意向)
。
I have two activities such as Activity
A and B and I'm trying to pass two different strings from A to B using Bundle
and startActivity(intent)
.
像这样:
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显示从A类分开。
And in class B I'm using two TextView
s to display the strings from class A seperately.
像这样:
Intent i = getIntent();
Bundle extras = i.getExtras();
filedetails = extras.getString("videodetails");
filename = extras.getString("videoname");
现在的问题是 filedetils
获得印刷类B中,但不是文件名。
The problem is filedetils
get printed in class B but not the file name.
这个解决的办法?
你有一个错字:
bundle.putString("vidoedetails", filedetails);
应
bundle.putString("videodetails", filedetails);
上一篇:simplecursoradapter TextView中给予的NullPointerExceptionsimplecursoradapter、TextView、NullPointerExceptio