How to pass Listview selected item values to another activity

前端 未结 2 1060
春和景丽
春和景丽 2021-01-15 02:19

I have successfully added Images from a ListView to a detailed View, when an item in the list is clicked on.But how would I add longer descriptions (which would not be shown

2条回答
  •  有刺的猬
    2021-01-15 03:02

        Intent i = new Intent(getApplicationContext(), SingleListItem.class);
                i.putExtra("str", longdesc);
                i.putExtra("zurag", imageId[position]);
                startActivity(i);
    

    in the singlelistitem class

     Intent i = getIntent();
            Intent i2 = getIntent();
            String text1 =i2.getStringExtra("str");
            texts.setText(text1);
    

提交回复
热议问题