The title of this question is not exactly reflects my question I have trimmed it because it went too lengthy. Sorry for my bad English too.
Okay,
I am using a library which has an activity, I am using that activity in my app. The orientation of that activity is working fine in tablets i.e., both landscape and portrait but in phones it sticks to portrait mode.
When I have seen the Manifest file of that library its like
<activity
android:name="DrawingActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:finishOnTaskLaunch="true"
android:screenOrientation="unspecified">
In the thread Android Orentation Changes. I came to know it should like android:screenOrientation="fullSensor" to work.
Now I am trying to override the screenOrientation property of the activity as said here
using tools:replace
attribute but still its not working. Please can anybody help me to solve this issue.
This is how I'm trying to achieve.
<activity
android:name="DrawingActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:finishOnTaskLaunch="true"
android:screenOrientation="fullSensor"
tools:replace="android:screenOrientation">
If my question is not clear/too broad please let me know I'll edit my question.
Regards
You can use tools:node="merge"
, for example:
<activity android:name="DrawingActivity"
android:screenOrientation="fullSensor"
tools:node="merge">
</activity>
this node will be merged with the existing one and overrides any duplicates.
for more details about this refer to https://developer.android.com/studio/build/manifest-merge#node_markers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With