I want to use same LinearLayout in different activities. Selected LinearLayout's id in picture is previewLinear. What I want to do is, use previewLinear in a different activity. I have A and B activities. Firstly I do some changes for previewLinear in activity A (adding border, slice it to pieces etc.) programmatically and I want to copy whole previewLinear to B activity.
pencerebol.xml
What I tried is;
A Activity: (container is static)
...
setContentView(R.layout.pencerebol);
...
container = (LinearLayout) findViewById(R.id.previewLinear);
container.setBackground(getResources().getDrawable(R.drawable.border));
B Activity:
...
setContentView(R.layout.pencerebol);
container = (LinearLayout) findViewById (R.id.previewLinear);
container = A.container; // I know that this line is completely wrong but this is what i want to do.
Thanks in advice.
If I got it right you want to make LinearLayout from B activity look same as in A activity.
You can create method in A activity
Then call it in B activity