2011年(13)
分类:
2011-02-01 10:52:20
原文地址:Android开发原理(今天看到的) 作者:dragonfly0427
void android_main(struct android_app* state) {
// Make sure glue isn't stripped.
app_dummy();
// loop waiting for stuff to do.
while (1) {
// Read all pending events.
int ident;
int events;
struct android_poll_source* source;
// Read events and draw a frame of animation.
if ((ident = ALooper_pollAll(0, NULL, &events,
(void**)&source)) >= 0) {
// Process this event.
if (source != NULL) {
source->process(state, source);
}
}
// draw a frame of animation
bringTheAwesome();
}
}