-3

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.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
RedXIII
  • 21
  • 3

1 Answers1

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.

Community
  • 1
  • 1
SamT01
  • 125
  • 1
  • 14