如何获得在Android的其他活动数据?

编程入门 行业动态 更新时间:2024-10-15 22:24:30
本文介绍了如何获得在Android的其他活动数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有两个活动,如活动 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 TextViews 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);

更多推荐

如何获得在Android的其他活动数据?

本文发布于:2023-11-27 10:39:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637733.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何获得   数据   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!