Code example for ObjectInputStream

Methods: close, readObject

0
	 
	public void loadBrocabulary() {  
        try { 
            FileInputStream fis = openFileInput("favorites.ser");
            if (fis != null) {
                ObjectInputStream in = new ObjectInputStream(fis);
                brocabList = (ArrayList<Brocab>)in.readObject();
                in.close();
            } 
            else { 
                // File didn't exist, nothing to do right now 
            } 
        } catch (Throwable t) {
            handleError(t);
        } 
        setListAdapter(new BrocabAdapter(this,android.R.layout.simple_list_item_1,brocabList));
    } 
	 
	@Override 
    public void onClick(View v) {
		Brocab brocab = brocabList.get((Integer)v.getTag());