How to set values after using model class for global ArrayList?

后端 未结 3 887
迷失自我
迷失自我 2021-01-29 10:59

I\'ve created one model class to store my product name,price and quantity,and then I attach it to another Fragment and try to display it in my TextView

3条回答
  •  滥情空心
    2021-01-29 11:37

    I can't really follow all this code. If I understand you correctly, you are having a problem passing the data around between your Activity, AsyncTask and Fragments. A good architecture here would be to have the Activity keep track of the data. The Fragment can always ask the Activity for the data and the AsyncTask can also call back to the Activity to update the data.

    If this isn't enough information to solve your problem, please show exactly the place where you are having trouble.

提交回复
热议问题