Android, Can I use putExtra to pass multiple values

前端 未结 6 1576
北恋
北恋 2020-12-02 06:54

I want to pass two values to another activity can I do this with putExtra or do I have to do it a more complicated way, which it seems from my reading. E.g.. can something l

6条回答
  •  天命终不由人
    2020-12-02 07:23

    No you can't but you can pass an array using:

    public Intent putExtra (String name, String[] value)
    

    like this for example:

    i.putExtra(ID_EXTRA, new String[]{"1", "111"});
    

提交回复
热议问题