美文网首页
使用意图传递数据

使用意图传递数据

作者: 叶秋_YQ | 来源:发表于2019-03-29 15:44 被阅读0次
开启意图
String str = "令狐冲";
Intent intent = new Intent(getContext(), ContentResultsActivity.class);
                       intent.putExtra("name",str);
                       startActivity(intent);
接收意图
        Intent intent = getIntent();
        int id = intent.getStringExtra("name");

相关文章

网友评论

      本文标题:使用意图传递数据

      本文链接:https://www.haomeiwen.com/subject/eonlbqtx.html