问题
I put together my first Mono for Android project (targeting API level 8, minimum Android 2.2) and deployed it to an HTC Incredible [1] running 2.3.4. Everything worked great and breakpoints in my main activities OnCreate
, OnStart
, OnResume
, OnPause
, and OnStop
all triggered as described on Xamarin's Activity Lifecycle tutorial.
Without changing any project settings, I swapped for a Samsung Galaxy Nexus running 4.0.2 and deployed the same app. It called OnCreate
just fine, but never triggered any of the other events when I switched away from the app.
How do I get these activity events to trigger in Ice Cream Sandwich (ICS) on the Galaxy Nexus?
回答1:
While running the first deployment on a Galaxy Nexus, you will see it deploying the "armeabi-v7a - 40202" assemblies. For some reason that stuck in my head when this issue started making things difficult.
If you go to the project properties and check the box for "armeabi-v7a" under "Supported architectures", these events will start being triggered as expected.
来源:https://stackoverflow.com/questions/10757138/mono-for-android-onpause-event-not-triggering-on-galaxy-nexus