編輯:關於Android編程
register_android_view_PointerIcon中進行初始化設置;
static struct { jclass clazz; jfieldID mStyle; jfieldID mBitmap; jfieldID mHotSpotX; jfieldID mHotSpotY; jmethodID getSystemIcon; jmethodID load; } gPointerIconClassInfo; int register_android_view_PointerIcon(JNIEnv* env) { FIND_CLASS(gPointerIconClassInfo.clazz, "android/view/PointerIcon"); GET_FIELD_ID(gPointerIconClassInfo.mBitmap, gPointerIconClassInfo.clazz, "mBitmap", "Landroid/graphics/Bitmap;"); GET_FIELD_ID(gPointerIconClassInfo.mStyle, gPointerIconClassInfo.clazz, "mStyle", "I"); GET_FIELD_ID(gPointerIconClassInfo.mHotSpotX, gPointerIconClassInfo.clazz, "mHotSpotX", "F"); GET_FIELD_ID(gPointerIconClassInfo.mHotSpotY, gPointerIconClassInfo.clazz, "mHotSpotY", "F"); GET_STATIC_METHOD_ID(gPointerIconClassInfo.getSystemIcon, gPointerIconClassInfo.clazz, "getSystemIcon", "(Landroid/content/Context;I)Landroid/view/PointerIcon;"); GET_METHOD_ID(gPointerIconClassInfo.load, gPointerIconClassInfo.clazz, "load", "(Landroid/content/Context;)Landroid/view/PointerIcon;"); return 0; }
2、register_android_view_PointerIcon是在AndroidRuntime.cpp中運行的;
extern int register_android_view_PointerIcon(JNIEnv* env); static const RegJNIRec gRegJNI[] = { REG_JNI(register_android_view_MotionEvent), REG_JNI(register_android_view_PointerIcon), REG_JNI(register_android_view_VelocityTracker), };
jobject android_view_PointerIcon_getSystemIcon(JNIEnv* env, jobject contextObj, int32_t style) { jobject pointerIconObj = env->CallStaticObjectMethod(gPointerIconClassInfo.clazz, gPointerIconClassInfo.getSystemIcon, contextObj, style); if (env->ExceptionCheck()) { ALOGW("An exception occurred while getting a pointer icon with style %d.", style); LOGW_EX(env); env->ExceptionClear(); return NULL; } return pointerIconObj; }
本文為大家分享了兩段PHP分頁類,很實用,供大家參考,具體內容如下<?php class Page { private $total; //總記錄
最近忙的起飛,本來想周末寫的東西結果拖到了今天,不過沒事。下午抽出點時間把工作做了下,開源給大家。https://github.com/ddwhan0123/Useful
Android平台是建立在Linux基礎上,以Java語言為主的一個操作系統平台。它的開發涉及到很多方面,但其實並不復雜,上面的路線圖看似需要學習的內容很多,但其實每個小
什麼是MVP?View層主要是用於展示數據並對用戶行為做出反饋。在Android平台上,他可以對應為Activity, Fragment,View