I am trying to start a new Activity based on the user selection of an item in Recyclerview. The user would tap on a selection and I want to get the background of that selected item and set it to the activity. So far I have tried
- Intent
- setContentView(View) as well as setContentView(Resource)
- View switcher.
None of these worked for me. I also would like to let the user hit back button and go back to the list of selection, should they change their mind. What is the best way to do this?
EDIT: the background is a drawable not a color. Intent was obviously not an option because I can't pass the drawable.
UPDATE: I set a public Drawable object in my main class and assigned it the background image of my selected item by calling view.Background(); Then I retrive that value and assign to my main layout of the next activity but it is still not working.
LinearLayout lt = (LinearLayout) findViewById(R.id.firstLayout);
lt.setBackground(MainClass.backgroundDrawable);
This part is not working in my new activity. I see the value is correct but that same Drawable is not assigned to the activity.