title: Set dynamically created TextView on frame layout
body: <p>I want to pass some data from one activity to another and set it in dynamically created <code>TextView</code> over frame layout of that activity..I'm using intent for that but at second activity the data is not getting extracted..Can any one tell me the simple way for this..
  Following is my code..</p>
  
  <p>Hidden.java</p>
  
  <pre><code>public class Hidden extends Activity implements OnClickListener {
  Button btnnameadd, btnnameremove, btnmobileadd, btnmobileremove, btndone;
  EditText etname, etmobile;
  ImageView ivlogo;
  private AlertDialog dialog;
  private Uri mImageCaptureUri;
  Intent jump;
  //options for image selection
  private static final int PICK_FROM_CAMERA = 1;
  private static final int CROP_FROM_CAMERA = 2;
  private static final int PICK_FROM_FILE = 3;
  LinearLayout llname, llmobile, llimage;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.hidden);
          captureImageInitialization();
  
          init();
  
  }
  
  private void init() {
      etname=(EditText)findViewById(R.id.editTextname);
      etmobile=(EditText)findViewById(R.id.editTextmobile);
      btnnameadd=(Button)findViewById(R.id.buttonnameadd);
      btnnameremove=(Button)findViewById(R.id.buttonnameremove);
      btnmobileadd=(Button)findViewById(R.id.buttonmobileadd);
      btnmobileremove=(Button)findViewById(R.id.buttonmobileremove);
      btndone=(Button)findViewById(R.id.buttondone);
      llname=(LinearLayout)findViewById(R.id.name);
      llmobile=(LinearLayout)findViewById(R.id.mobile);
      btnnameadd.setOnClickListener(this);
      btnnameadd.setOnClickListener(this);
      btnnameremove.setOnClickListener(this);
      btnmobileadd.setOnClickListener(this);
      btnmobileremove.setOnClickListener(this);
      btndone.setOnClickListener(this);
  
  }
  
  @Override
  public void onClick(View v) {
      jump=new Intent(Hidden.this,Framelayout.class);
      if(v.getId()==R.id.buttonnameadd)
      {
          String strname=etname.getText().toString();
          Log.d("Log",strname);
          jump.putExtra("Name",strname);
      }else if(v.getId()==R.id.buttonnameremove)
      {
          btnnameremove.setEnabled(false);
          llname.removeView(findViewById(R.id.editTextname));
      }else if(v.getId()==R.id.buttonmobileadd)
      {
          String strmobile=etmobile.getText().toString();
          Log.d("Log",strmobile);
          jump.putExtra("Mobile",strmobile);
          Log.d("LOG",jump.putExtra("Mobile",strmobile).toString());
      }else if(v.getId()==R.id.buttonmobileremove)
      {
          llmobile.removeView(findViewById(R.id.editTextmobile));         
      }else if(v.getId()==R.id.buttondone)
      {
          Log.d("LOG","1");
          startActivity(jump);
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>FrameLayout.java</p>
  
  <pre><code>public class Framelayout extends Activity implements OnClickListener {
  FrameLayout frameLayout;
  Button b2,b3;
  //private ProgressDialog pDialog;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_framelayout);
      frameLayout = (FrameLayout)findViewById(R.id.f1);
       b2=(Button)findViewById(R.id.button2);
       b3=(Button)findViewById(R.id.buttonload);
   b2.setOnClickListener(this);
       b3.setOnClickListener(this);
  
    }
  public void onClick(View v) {
       if(v.getId()==R.id.button2){
          Intent i=new Intent(Framelayout.this,Hidden.class);
          startActivity(i);
      }else if(v.getId()==R.id.buttonload){
          Log.d("Log",getIntent().getStringExtra("Name"));
           editframelayout();
      }
  }
  
  private void editframelayout() {
      String name=getIntent().getExtras().getString("Name");
      String mobile=getIntent().getExtras().getString("Mobile");
      TextView tvname=new TextView(this);
      tvname.setText(name);
      tvname.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
      tvname.setGravity(Gravity.CENTER);
      TextView tvmobile=new TextView(this);
      tvmobile.setText(mobile);
      tvmobile.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
      tvmobile.setGravity(Gravity.CENTER);
      frameLayout.addView(tvname);
      frameLayout.addView(tvmobile);
  }
  </code></pre>
  
  <p>}</p>