Send data from activity to fragment in Android

前端 未结 20 2746
悲哀的现实
悲哀的现实 2020-11-21 05:13

I have two classes. First is activity, second is a fragment where I have some EditText. In activity I have a subclass with async-task and in method doInBa

20条回答
  •  时光说笑
    2020-11-21 05:37

    In your activity declare static variable

    public static HashMap contactItems=new HashMap();
    

    Then in your fragment do like follow

    ActivityName.contactItems.put(Number,contactsModal);
    

提交回复
热议问题