Android Refresh activity when returns to it

后端 未结 7 2115
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:19

    Call child activity using startActivityForResult with request code,SetResult from the child Activity. And when the child activity is finished, you can update you parent activity in onActivityResult method

    @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
            // TODO Auto-generated method stub
            super.onActivityResult(requestCode, resultCode, data);
    
          //Check the result and request code here and update ur activity class
    
        }
    

    Here is an example http://rahulonblog.blogspot.com/2010/05/android-startactivityforresult-example.html

提交回复
热议问题