// Path: java/anyremote/client/android/util/InfoMessage.java
// public class InfoMessage {
// 	public int id;
// 	public int stage;
// }
// 
// Path: java/anyremote/client/android/util/ProtocolMessage.java
// public class ProtocolMessage {
// 	public static final int FULL     = 0;
// 	public static final int FIRST    = 1;
// 	public static final int INTERMED = 2;
// 	public static final int LAST     = 3;
// 	
// 	public int id;
// 	public int stage;
// 	public Vector tokens;
// }


import android.widget.ImageButton;
import android.view.GestureDetector.OnGestureListener;
import android.view.GestureDetector;
import anyremote.client.android.util.InfoMessage;
import anyremote.client.android.util.ProtocolMessage;
import anyremote.client.android.R;
import android.os.Bundle;
import android.os.Handler;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Display;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.view.MotionEvent;
		
		log("doFinish");
		exiting = true;
		finish();  	
	}

	@Override
	public void onBackPressed() { 
		commandAction(anyRemote.protocol.context.getString(R.string.back_item));
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		commandAction(item.getTitle().toString());
		return true;
	}

	public void commandAction(String command) {
		if (command.equals(anyRemote.protocol.context.getString(R.string.back_item))) {
			command = "Back";  // avoid national alphabets
		}
		anyRemote.protocol.queueCommand(command);
	}

	public void handleEvent(InfoMessage data) {
		
		log("handleEvent " + Dispatcher.cmdStr(data.id) + " " + data.stage);
		
		checkPopup();

// Path: java/anyremote/client/android/util/InfoMessage.java
// public class InfoMessage {
// 	public int id;
// 	public int stage;
// }
// 
// Path: java/anyremote/client/android/util/ProtocolMessage.java
// public class ProtocolMessage {
// 	public static final int FULL     = 0;
// 	public static final int FIRST    = 1;
// 	public static final int INTERMED = 2;
// 	public static final int LAST     = 3;
// 	
// 	public int id;
// 	public int stage;
// 	public Vector tokens;
// }


// Path: java/anyremote/client/android/WinManager.java
import android.widget.ImageButton;
import android.view.GestureDetector.OnGestureListener;
import android.view.GestureDetector;
import anyremote.client.android.util.InfoMessage;
import anyremote.client.android.util.ProtocolMessage;
import anyremote.client.android.R;
import android.os.Bundle;
import android.os.Handler;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Display;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.view.MotionEvent;

		
		log("doFinish");
		exiting = true;
		finish();  	
	}

	@Override
	public void onBackPressed() { 
		commandAction(anyRemote.protocol.context.getString(R.string.back_item));
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		commandAction(item.getTitle().toString());
		return true;
	}

	public void commandAction(String command) {
		if (command.equals(anyRemote.protocol.context.getString(R.string.back_item))) {
			command = "Back";  // avoid national alphabets
		}
		anyRemote.protocol.queueCommand(command);
	}

	public void handleEvent(InfoMessage data) {
		
		log("handleEvent " + Dispatcher.cmdStr(data.id) + " " + data.stage);
		
		checkPopup();

		if (data.stage == ProtocolMessage.FULL || data.stage == ProtocolMessage.FIRST) {