in your first Activity Intent my_intent = new Intent(FirstScreen.this.getApplication(), SecondScreen.class);
my_intent.putExtra("Value_String", "HaiHow R U"); startActivity(intent); in your Second Activity in onCreate Bundle extras = getIntent().getExtras(); String fromFirstActivity= extras.getString("Value_String"); you can use fromFirstActivity as from previous activity value imp: the value pasesed in putExtras() // Value_String use the same for get the value in second Activity On Tue, Feb 24, 2009 at 2:12 PM, gganesh <ganesh....@gmail.com> wrote: > > but the code " your_extras.getExtras(myval) ; " > didn't work ,i suppose there is no such method in Bundle class > i tried as show below > Bundle your_extras = this.getIntent().getExtras(); > String val = (String) your_extras.get("myval"); > but the "val" doesn't gives me the required data > Any suggestions ? > Thanks > > > > > > On Feb 24, 10:46 am, dillirao malipeddi <dillir...@arijasoft.com> > wrote: > > you have to > > use > > > > Bundle your_extras = getIntent.getExtras(); > > > > String val = your_extras.getExtras("myval"); > > > > > > > > On Tue, Feb 24, 2009 at 11:08 AM, gganesh <ganesh....@gmail.com> wrote: > > > > > hi friends, > > > i have two classes Screen1 and Screen2 both extends activity > > > i have to pass data from the Screen1 to Screen 2 > > > > > i wrote in onCreate method of Screen1 class > > > > > t=(EditText)findViewById(R.id.ed1); > > > b=(Button)findViewById(R.id.but1); > > > b.setOnClickListener(new Button.OnClickListener() > > > { > > > public void onClick(View v) > > > { > > > Intent i= new > Intent(v.getContext(),Screen2.class); > > > i.putExtra("myval",t.toString()); > > > startActivity(i); > > > } > > > > > My doubt is ,how to receive myval data in Screen2 class ,what is the > > > code i have to add in AndroidManifest.xml file > > > > -- > > Dilli Rao. M > > ARIJASOFT > > +91 - 9703073540 > > > -- Dilli Rao. M ARIJASOFT +91 - 9703073540 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---