opt
This commit is contained in:
@@ -23,6 +23,8 @@ public class BnHooker implements InvocationHandler {
|
||||
private static final String TAG = "BnHooker";
|
||||
|
||||
private Object host;
|
||||
private Method getGLMapEngineMethod;
|
||||
private GLMapEngine glMapEngineObject;
|
||||
|
||||
public BnHooker( AMap map ) throws Exception {
|
||||
|
||||
@@ -47,11 +49,17 @@ public class BnHooker implements InvocationHandler {
|
||||
}
|
||||
|
||||
public void clearAllMessages() throws Exception {
|
||||
Method method = host.getClass().getDeclaredMethod( "getGLMapEngine" );
|
||||
method.setAccessible( true );
|
||||
GLMapEngine glMapEngine = ( GLMapEngine ) method.invoke( host );
|
||||
clearMessageList( "mStateMessageList", glMapEngine );
|
||||
clearMessageList( "mAnimateStateMessageList", glMapEngine );
|
||||
if ( glMapEngineObject == null ) {
|
||||
if ( getGLMapEngineMethod == null ) {
|
||||
getGLMapEngineMethod = host.getClass().getDeclaredMethod( "getGLMapEngine" );
|
||||
getGLMapEngineMethod.setAccessible( true );
|
||||
}
|
||||
glMapEngineObject = ( GLMapEngine ) getGLMapEngineMethod.invoke( host );
|
||||
}
|
||||
if ( glMapEngineObject != null ) {
|
||||
clearMessageList( "mStateMessageList", glMapEngineObject );
|
||||
clearMessageList( "mAnimateStateMessageList", glMapEngineObject );
|
||||
}
|
||||
}
|
||||
|
||||
private void clearMessageList( String filedName, Object obj ) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user