0

I have many activity that has same attributes,

    <activity android:name="com.packagename.a" android:screenOrientation="sensorLandscape"/>
    <activity android:name="com.packagename.b" android:screenOrientation="sensorLandscape"/>
    <activity android:name="com.packagename.c" android:screenOrientation="sensorLandscape"/>
    <activity android:name="com.packagename.d" android:screenOrientation="sensorLandscape"/>
    <activity android:name="com.packagename.e" android:screenOrientation="sensorLandscape"/>
    <activity android:name="com.packagename.f" android:screenOrientation="sensorLandscape"/>
    <activity android:name="com.packagename.g" android:screenOrientation="sensorLandscape"/>
    <activity android:name="com.packagename.h" android:screenOrientation="sensorLandscape"/>
    <activity android:name="com.packagename.i" android:screenOrientation="sensorLandscape"/>

Is there any simple way to declare the attributes once?

1 Answers1

0

The simple way is doing this in a BaseActivity in Java code, and all other activities inherit this BaseActivity, but it seems those activity's attributes can not be applied programmatically. Check here

If you feel tedious of typing these attributes, I suggest you to utilize the editor to finish your job, such as XML code snippet or other methods.

Community
  • 1
  • 1
alijandro
  • 11,627
  • 2
  • 58
  • 74