/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_reflection); SFBridgeManager.register(this); SFBridgeManager.register(myObject); }
@SFIntegerMessage(messageId = ActivityMessageId.OBJECTTEST1, theadId = ThreadId.BackThread) public void objectTest1(String str, Integer num) { Log.e(TAG, "method->objectTest1,str: " + str + " num: " + num); L.error(TAG, "method->objectTest1,thread name: " + Thread.currentThread().getName()); if (num == 4) { SFBridgeManager.unregister(this); } SFBridgeManager.send(ActivityMessageId.OBJECTTEST1, "object hello", ++num); }
@Override protected void onDestroy() { super.onDestroy(); SFBridgeManager.unregister(this); }
private void doObjectTest1() { SFBridgeManager.send(ActivityMessageId.OBJECTTEST1, "object hello", 1); }
private void doTest2() { SFBridgeManager.send(ActivityMessageId.TEST2); }
private void doTest1() { SFBridgeManager.send(ActivityMessageId.TEST1, "hello"); }