title: How can I change image of an inflated layout?
body: <p>Here is my adapter:</p>
  
  <pre><code>    @Override
      public Object instantiateItem(ViewGroup container, int position) {
          // TODO Auto-generated method stub
          final Activity activity = (Activity) mContext;
          mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          View itemView = mInflater.inflate(R.layout.item_initial_activity_viewpager, container, false);
  
  
         TextView mTextView  = (TextView) itemView.findViewById(R.id.btn_initial);
         mTextView.setOnClickListener(new View.OnClickListener() {
  
                  @Override
                  public void onClick(View v) {
                      // TODO Auto-generated method stub
                      Intent it = new Intent(activity, PassCodeActivity.class);
                      activity.startActivityForResult(it, ApplicationData.INITIAL_PASSCODE_REQUEST_CODE);
                  }
              });
  </code></pre>
  
  <p>My inflated layout have a TextView and an ImageView. What I want is when I click the TextView,the <strong>second activity</strong> will be opened and after I finished doing something in <strong>second activity</strong>, I can close it and change image of the ImageView in <strong>first acitivty</strong>. Here is what I did so far:</p>
  
  <p>In the <strong>second activity</strong> I set:</p>
  
  <pre><code>Intent intent= getIntent();
  setResult(ApplicationData.INITIAL_PASSCODE_RESULT_CODE, intent);
  finish(); 
  </code></pre>
  
  <p>And in the <strong>first activity</strong> I set:</p>
  
  <pre><code>@Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          // TODO Auto-generated method stub
          super.onActivityResult(requestCode, resultCode, data);
          if(resultCode==ApplicationData.INITIAL_PASSCODE_RESULT_CODE){
  
              LayoutInflater mInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              View itemView = mInflater.inflate(R.layout.item_initial_activity_viewpager, null);
              ImageView imageButton = (ImageView) itemView.findViewById(R.id.img_initial_button);
              imageButton.setBackgroundResource(R.drawable.btn_img_key_setting);
          }
      }
  </code></pre>
  
  <p>But nothing happen.The image is not changed at all and there is no logcat. Please show me how to fix this!</p>