-1

I am calling a new Activity which displays a layout with a text box in a new activity for a text input.

  private void openDialogue()
        {   
            Intent intent = new Intent(this, Activity_OpenDialogue.class);
            startActivity(intent);
        }

I wish to be able to access that text object from within my class which created the new activity, or pass that newly created object back to the calling class. Note I do not want to simply access the string I wish to pass the entire EditText box object.

user2206836
  • 7
  • 1
  • 5
  • 1
    Possible duplicate of [Sending data back to the Main Activity in android](http://stackoverflow.com/questions/920306/sending-data-back-to-the-main-activity-in-android) – George Mulligan Feb 04 '16 at 18:17
  • Please do a normal google/SO search before posting questions. There are 100s of similar questions on SO. No need to post a new duplicate every time. – Rohit5k2 Feb 04 '16 at 18:22
  • This answer is only sending a string back, I with the entire object to be passed back – user2206836 Feb 04 '16 at 19:01
  • @user2206836: this is my google search. Can you see anything https://www.google.co.in/search?q=passing+object+to+activity+android&ie=utf-8&oe=utf-8&gws_rd=cr&ei=-rKzVvOaBcHuugTVl5DwDQ – Rohit5k2 Feb 04 '16 at 20:22

2 Answers2

0

You can start an activity for result like this Activity for result also, you can send some extras to new activity and have it back. Text object you think String class object?

Tomas Cejka
  • 96
  • 1
  • 8
  • Please don't answer for a question which has many many duplicates. Here is our discussion on meta http://meta.stackoverflow.com/questions/315936/what-to-do-when-a-user-asks-for-acceptance – Rohit5k2 Feb 04 '16 at 18:26
0

With the Extra and Bundle methods from Intent, check this other question.

Community
  • 1
  • 1
  • Please don't answer for a question which has many many duplicates. Here is our discussion on meta http://meta.stackoverflow.com/questions/315936/what-to-do-when-a-user-asks-for-acceptance – Rohit5k2 Feb 04 '16 at 18:27