繁体   English   中英

检索意图附加项

[英]Retreive intent extras

我在我的项目中使用了一个意图,但似乎我不知道如何使用它。

这是我的“设置”活动:

Intent i = new Intent(SettingsActivity.this, MainActivity.class);

i.putExtra("double", seekbar.getProgress());
startActivity(i);

这里是我的“主要”活动:

String double_places;
Intent intent = getIntent();
double_places = intent.getStringExtra("double");

TextView textView = findViewById(R.id.textView);
textView.setText(double_places);

问题出在哪儿?

String double_places = getIntent().getStringExtra("double");

TextView textView = findViewById(R.id.textView);
textView.setText(double_places);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM