我有两个活动,比如ActivityA和B,我试图通过从A两个不同的字符串中使用到B Bundle和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);
Run Code Online (Sandbox Code Playgroud)
在B级我用两个TextViews分别显示A类的弦乐.
像那样:
Intent i = getIntent();
Bundle extras = i.getExtras();
filedetails = extras.getString("videodetails");
filename = extras.getString("videoname");
Run Code Online (Sandbox Code Playgroud)
问题是filedetils在B类中打印,但不是文件名.
对此有何解决方案?