192 {
193 if (view == null) {
194 return;
195 }
196 View stateItem = (View) parent.getParent();
197 String stateName = ((TextView) stateItem.findViewById(
R.id.nameText)).getText().toString();
198 String stateValue = ((TextView) view).getText().toString();
199 if (!stateValue.equals(stateItem.getTag(
R.integer.value_tag_key))) {
200 stateItem.setTag(null);
202 }
203
204
205
206
207 final Object oldValue = stateItem.getTag(
R.integer.value_tag_key);
208 if (stateName.equals(BACKEND_STATE_NAME)
209 && oldValue != null && !stateValue.equals(oldValue)) {
210 LinearLayout mainLayout = (LinearLayout) mViewerActivity.findViewById(
R.id.mainLayout);
211 mainLayout.removeAllViews();
212 SurfaceView surfaceView = new SurfaceView(mViewerActivity);
213 surfaceView.setId(
R.id.surfaceView);
214 surfaceView.getHolder().addCallback(mViewerActivity);
215 surfaceView.setOnTouchListener(mViewerActivity);
216 mainLayout.addView(surfaceView);
217 }
218 }
void onStateChanged(String stateName, String stateValue)