@Override public void onClick(View v) { switch (v.getId()) { case R.id.start_btn: if (makeFbReadable() /* && mCurrentRenderIp != null*/) { NativeAshare.setRotate(mDisplay.getRotation()); // stb ip NativeAshare.shareScreen(mJniCallback, "192.168.43.1"); mOrentationListener = new MyOrientationEventListener(AshareStartActivity.this); mOrentationListener.enable(); } else { Log.d(TAG, "fb open failure!!!"); } break; case R.id.stop_btn: NativeAshare.stopShare(); if (mOrentationListener != null) { mOrentationListener.disable(); } break; default: break; } }