0

in our app we have a Button which starts the Camera. At the same time we want to show a Toast which rotates when the user rotate the screen/change orientation, during the camera is shown.

The problem here is, that we start the Toast with the Context of our fragment/activity. As long as the Camera is shown the Toast doesn't recognize that his "originally" context (Activity/Fragment) change its orientation, because it's dead!

I doubt if Toast is the best solution to do this... Maybe there is something more appropriate then a Toast for this situation?

Thanks in advance!

iFoukis
  • 274
  • 1
  • 2
  • 11
  • 1
    In general it is difficult to have any control over the display once you launch the camera, unless you also write the camera app. This suggests that whatever you need to tell the user, you tell them before launching the camera, whether with a toast or a dialog or some other method. – x-code Aug 06 '14 at 18:19
  • Here's a similar question with the answer - http://stackoverflow.com/questions/6234473/android-is-there-a-way-to-rotate-a-toast-90-degrees – ernazm Aug 07 '14 at 16:05
  • Thanks for your tip, but i've used these two classes/customViews. They just rotate the TextView, but they arent "rotateable" while the camera is shown. The same problem as in my initial post... there "Context" is dead/sleeping. – iFoukis Aug 11 '14 at 06:07
  • So, the problem is what you're not receiving callbacks like onConfigurationChanged() in activtiy? If so, have you tried to use Service, it also can listen for rotation? – sandrstar Aug 11 '14 at 14:52
  • Thanks Sandrstar, i tried using Service and also BroadcastReceiver. The camera on my HTC One e.g. doesn't fire an "orientation-change" broadcast because the camera-app doesn't rotate the whole device, only the "elements" inside the camera-app. Its really confusing and hard to find a solution. – iFoukis Aug 12 '14 at 06:18

0 Answers0