Android 如何将另一个活动传递的数据放在listView上?

Android 如何将另一个活动传递的数据放在listView上?,android,listview,android-listview,Android,Listview,Android Listview,这是我的第二节课。我想把这个“选择”放在listView上 listViewDesc = (ListView) findViewById(R.id.lvDesc); listViewPrice = (ListView) findViewById(R.id.lvPrice); Bundle extras = getIntent().getExtras(); String choice = null; if(extras != null) cho

这是我的第二节课。我想把这个“选择”放在listView上

    listViewDesc = (ListView) findViewById(R.id.lvDesc);
    listViewPrice = (ListView) findViewById(R.id.lvPrice);


    Bundle extras = getIntent().getExtras();
    String choice = null;
    if(extras != null)

    choice = extras.getString("name");

    Toast.makeText(getApplicationContext(), choice, Toast.LENGTH_SHORT).show();

请参阅以下教程,这是一个简单的listview示例。你已经有你的弦了,所以把它放在他显示的方式中


有一些数据是从另一个类传递到这个类的..为了检查数据是否真的在传递,我放置了Toast,它正在正确执行。现在我想把数据放在listView上,而不是Toast上。我的意思是,到目前为止,为了实现将数据放入ListView的目标,您做了哪些尝试?这就是我得到的全部,我看了不同的例子,但是dint发现了任何与我的Qestion相关的东西。你只想显示一个通过
Intent
传递到
ListView
String
?有很多关于如何做的文档。
planetsList.add(createPlanet("planet", choice));