1

I have 2 activities on android, in one activity I have 3 RadioButtons and a button called send, and when I select the first radiobutton and press the button send I want to send that radio button and his functionality to the second activity, and the radio button should be visible in the second activity until I decide to delete it from the second activity.

like:

Activity A: -radioButton1 onclick(send)

activity B: Received a reference of radioButton1 and his functionality.

is important to know that I don't want to start the second activity I just want to send a reference from the radiobutton from ActivityA to activityB.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
  • Wrap the data which you need to send to other activity in bundle and pass it while initiating the activity. http://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android – harshal Dec 31 '13 at 14:09

2 Answers2

1

The radioButton is a View, so it cannot be "passed" between activities. You have to create another instance of RadioButton with the same text as the selected before.

See more:http://developer.android.com/guide/components/activities.html#StartingAnActivity

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
Leaudro
  • 1,021
  • 8
  • 7
0

I would prefer passing only feasible data of radio button from Activity A to B then re creating radio button at Activity B. Bundle the data and pass in while creatingg intent to another Activity.

harshal
  • 592
  • 6
  • 25