Is it possoble to rotate the whole android userinterface on an eventlistener ? For example an app which runs in the background and after putting the headphones in the whole interface turn 180° until you put it out again.
Asked
Active
Viewed 124 times
1 Answers
0
Yes it is possible to change layout programmatically (Although not sure about 180 degrees?).
See this link: Change Screen Orientation programmatically using a Button
The first answer he has explained how to change layout programmatically instead of setOnClickListner you can use your eventListener.
EDIT: Look at this: https://developer.android.com/reference/android/content/Intent.html#ACTION_HEADSET_PLUG
Its the broadcast which takes place in the event a headset was plugged in.