0

In my app, I create the gridview and then add the view by RelativeLayout LayoutParams. But how can i call it in another activity? such as gridview looping the 10 article and hide the icon, i create the edit button to control hide/show the icon. but i dont know how to call it.

Thanks.

  • I think you should show some code. You can't add a view by adding RelativeLayout.LayoutParams. ...and a View does not persist across activities. ...and so on. – G. Blake Meike Sep 25 '14 at 02:31
  • Thanks for your comment. because the coding too large so i can't just show here. But in my issue is i just want to get the id of imageview with tag in another activity. – user2357288 Sep 25 '14 at 04:00

1 Answers1

0

Once you switch activities, I don't think you can directly access the ui elements of the previous activity. You should try to send data between activities by creating intents with arguments like this :

Start an Activity with a parameter

If you from activity A to B and you want to pass data back to A, launch A with an intent that has the extra data you need.

Parse the data from the intent and update your UI accordingly.

Community
  • 1
  • 1
HailZeon
  • 954
  • 9
  • 17