First I got to apologize for that double posting. I got impatient since it took so long for the message to appear.
In the meantime I figured it out myself, indeed using android:configChanges within the Activity tag in the AndroidManifest. Now it works like a charm. Having solved this, a new question arises: how can I securely exit the app when it loses focus, i.e. the user returns to the homescreen? I don't want no background process. Thanks to all, Steff On 15 Dez., 19:29, G <ghack...@gmail.com> wrote: > You need to check the Activity's entry in the Manifest and alter the > android:configChanges to include keyboardHidden and orientation > Then you need to override OnConfigurationChanged() method in your > activity. > > More details > here...http://developer.android.com/guide/topics/manifest/activity-element.h... > > On Dec 15, 7:10 am, steff <stefan.dierd...@googlemail.com> wrote: > > > > > Hi everyone, > > > I got my hands on Android which is really fun. But at some point I > > don't seem to understand the concept. I've got a Main class which > > reads like this: > > > public class Main extends Activity implements SensorEventListener > > { ... } > > > in the onCreate(...) I set the layout to > > setContentView(R.layout.main); > > and add an OnTouchEvent Listener to the sole View in main.xml: > > myView.setOnTouchListener(new OnTouchListener() { > > @Override > > public boolean onTouch(View v, MotionEvent event) > > {... > > > As you can see I also implemented a SensorEventListener which is used > > if required. All works fine so far. > > > But my problem is this (at this point my misunderstanding kicks in): > > whenever I rotate the device the onCreate(), onStart() etc. methods > > are called, causing my app to act as if it just started. Furthermore, > > I feel unable to implement an onSizeChanged(int w, int h, int oldw, > > int oldh) { ... } Listener. > > > Can anyone please explain where my error in reasoning is? I am working > > on a tiny app which is more or less done, except for the just > > mentioned bug(s). Maybe I got it all wrong but it does what it is > > supposed to do (i.e. sending touch positions and accelerometer data > > over the network via UDP). > > > Thanks for any help. > > Regards, > > Steff -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en