Android Refresh activity when returns to it

后端 未结 7 1950
Happy的楠姐
Happy的楠姐 2021-02-07 10:41

I need a little help with refreshing one of my activities in my application. I\'m using tab host activity and connecting to web service and downloading some data from one of my

相关标签:
7条回答
  • 2021-02-07 11:34

    You should handle the result of activity that you started with "startActivityForResult" in a parent activity in a method:

    @override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
       //...
    }
    

    And depending on result you could just invoke again a code that is responsible for showing the information in your parent activity (may be you put it into onResume() method or like that).

    I would suggest you to move all the logic responsible for information rendering to a separate method. And invoke it after you recieve the result. Instead of restarting your parent activity.

    0 讨论(0)
提交回复
热议问题