title: how to do popup window pass value back to the background window in android
body: <p>I want to use popupwindow in my app.</p>
  
  <p>click button1 can triggle the window popup,</p>
  
  <p>click btnback in popwindow will close it .</p>
  
  <p>but it failed in my program.</p>
  
  <p>Also I want to send a value in the edittext which is in popwindow back to the backgroung window</p>
  
  <p>how can i do it?
  tks!</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
  
  super.onCreate(savedInstanceState);
  
  final LayoutInflater inflater = (LayoutInflater)
  
  this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
  final PopupWindow pw = new PopupWindow(
  
  inflater.inflate(R.layout.activity_setting, null, false), 
  
  200, 
  200, 
  true);
  
  setContentView(R.layout.activity_memo);
  
  Button bt1 = (Button) findViewById(R.id.button1); 
  
  Button bt2 = (Button) findViewById(R.id.btnBack); 
  
  bt1.setOnClickListener(new Button.OnClickListener()
  
  {
  
  @Override
  
  public void onClick(View v) { 
  
  View layout = inflater.inflate(R.layout.activity_memo, listView);
  
  showAtLocation(layout, Gravity.CENTER, 0, 0); 
  
  }
  
  });
  
  bt1.setOnClickListener(new Button.OnClickListener()
  
  {
  
  @Override
  
  public void onClick(View v) { 
  
  pw.dismiss();
  
  }
  
  });
  
  }
  </code></pre>