(Android) Sharing data between activities using public static fields
===

I'm trying to implement an application that allows searching a binary tree using 3 different co-routine activities. These activities can be chosen to run in any order, and each should be able to access shared data about the latest visited nodes so that they can continue searching a binary tree. It is a little bit complicated to explain this in words so I guess I should paste part of my code here. Below is the code of one of my co-routine activities (the other two are basically the same):

    public class CoRoutineOne extends Activity {
    	public void onCreate(Bundle savedInstanceState){
    		super.onCreate(savedInstanceState);
    		try{
    			SearchSharedTreeActivity.current = SearchSharedTreeActivity.tree.search
    					(SearchSharedTreeActivity.item, (BinaryTree.Node)SearchSharedTreeActivity.nodeList.get(SearchSharedTreeActivity.nodeList.size() - 1));
    			SearchSharedTreeActivity.nodeList.add(SearchSharedTreeActivity.current);
    			setResult(Activity.RESULT_OK);
    		}catch(Exception e){
    			setResult(Activity.RESULT_CANCELED);
    		}
    		finish();
    	}
    }  

The main activity's code:

    public class SearchSharedTreeActivity extends Activity implements OnClickListener {
    	private EditText target = null;
    	private EditText corout1 = null;
    	private EditText corout2 = null;
    	private EditText corout3 = null;
    	
    	private Button target_btn = null;
    	private Button corout1_btn = null;
    	private Button corout2_btn = null;
    	private Button corout3_btn = null;
    	
    	private static final int COROUT_ONE_REQCODE = 1;
    	private static final int COROUT_TWO_REQCODE = 2;
    	private static final int COROUT_THREE_REQCODE = 3;
    	
    	public static BinaryTree tree = null;
    	public static Vector nodeList = null;
    	public static BinaryTree.Node current = null;
    	public static Comparable item = null;
     	
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            
            tree = new BinaryTree();
            Comparable[] values = {20, 10, 30, 5, 17, 25, 40, 11, 35, 55};
            tree.insert(values);
            
            target = (EditText) findViewById(R.id.target_input);
            corout1 = (EditText) findViewById(R.id.co1_output);
            corout2 = (EditText) findViewById(R.id.co2_output);
            corout3 = (EditText) findViewById(R.id.co3_output);
            
            target_btn = (Button) findViewById(R.id.target_btn);
            corout1_btn = (Button) findViewById(R.id.co1_btn);
            corout2_btn = (Button) findViewById(R.id.co2_btn);
            corout3_btn = (Button) findViewById(R.id.co3_btn);
            
            target_btn.setOnClickListener(this);
            corout1_btn.setOnClickListener(this);
            corout2_btn.setOnClickListener(this);
            corout3_btn.setOnClickListener(this);
        }
        
        public void onClick(View view){
        	Button btn = (Button) view;
        	int id = btn.getId();
        	if (id == R.id.target_btn){
        		item = target.getText().toString();
        		try{
        			Integer.parseInt((String) item);
        			target.setText("Target is " + item);
        		}catch (Exception e){
        			target.setText("");
        			corout1.setText("");
        			corout2.setText("");
        			corout3.setText("");
        		}
        	}
        	else if (id == R.id.co1_btn){
        		Intent i1 =  new Intent(this, CoRoutineOne.class);
        		startActivityForResult(i1, COROUT_ONE_REQCODE);
        	}
        	else if (id == R.id.co2_btn){
        		Intent i2 =  new Intent(this, CoRoutineTwo.class);
        		startActivityForResult(i2, COROUT_TWO_REQCODE);
        	}
        	else if (id == R.id.co3_btn){
        		Intent i3 =  new Intent(this, CoRoutineThree.class);
        		startActivityForResult(i3, COROUT_THREE_REQCODE);
        	}
        }
        
        public void onActivityResult(int requestCode, int resultCode, Intent data){
        	if (requestCode == COROUT_ONE_REQCODE){
        		if (resultCode == Activity.RESULT_OK){
        			if (item.equals(current.value))
        				corout1.setText("Found " + current.value);
        			else if (current == null)
        				corout1.setText("Not found");
        			else
        				corout1.setText("Reached " + current.value);
        		}
        		else
        			corout1.setText("Problem finding target");
        	}
        	
        	else if (requestCode == COROUT_TWO_REQCODE){
        		if (resultCode == Activity.RESULT_OK){
        			if (item.equals(current.value))
        				corout2.setText("Found " + current.value);
        			else if (current == null)
        				corout2.setText("Not found");
        			else
        				corout2.setText("Reached " + current.value);
        		}
        		else
        			corout2.setText("Problem finding target");
        	}
        	
        	else if (requestCode == COROUT_THREE_REQCODE){
        		if (resultCode == Activity.RESULT_OK){
        			if (item.equals(current.value))
        				corout3.setText("Found " + current.value);
        			else if (current == null)
        				corout3.setText("Not found");
        			else
        				corout3.setText("Reached " + current.value);
        		}
        		else
        			corout3.setText("Problem finding target");
        	}
        }
    }

As can be seen from the above code of my main activity, I've set the fields `tree`, `nodeList` (the list of visited nodes), `current` (currently visited node) and `item` (element to be searched in the tree) to `public static` so that my co-routine activities can easily access them. But somehow this doesn't work, I always get `NullPointerException` and then `RESULT_CANCELED` when calling any of the co-routine activities.

Please help me point out the problem. Any suggestion is appreciated. Thanks.
