Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extend Activity changing only the layout

Is it possible to extend an existing activity changing only its layout (eg. colors)?

Because i'm using a shared library and i shouldn't modify the activity since others are using it.

like image 765
Mark Avatar asked Apr 14 '26 12:04

Mark


2 Answers

You would have to put that new Activity in the manifest and then make sure the intent resolution goes to your child class. Your not just going to be able to extend the activity and have it called without fixing this (at least I don't think so).

You can also just set the background color in java or xml.

like image 160
Frank Sposaro Avatar answered Apr 16 '26 02:04

Frank Sposaro


Yes.It is possible , Just use the word extends.

If u have 2 activity Activity1 and 2nd Activity2. U can use Activity2 extends Activity1 Then u can use the property of Activity1.

like image 39
anoop Avatar answered Apr 16 '26 02:04

anoop



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!