public void onClick(View v){ int id=v.get(); // getting ID of Clicked View switch(id){ case R.id.button1: //called when you press button 1 //write your code break; case R.id.button2: //called when you press button 2 //write your code break; ... }
@Override public int read(byte[] b, int off, int len) throws IOException { int l = -1; if (blockForContent()) l = _content.get(b, off, len); return l; }
@Override public int read() throws IOException { int c = -1; if (blockForContent()) c = 0xff & _content.get(); return c; }