Code example for Layout

Methods: getLineForOffset, getLineTop

0
	    @Override protected void onPostExecute(String result) {
	    	try{ // View not attached to window manager 
	    		_tvTest.setText(result);
		        _pdProgress.dismiss();
		        Layout layout = _tvTest.getLayout();
				int line = layout.getLineForOffset(_offset); 
				_top = layout.getLineTop(line);
				_svTest.post(new Runnable(){
					@Override public void run() { 
						_svTest.scrollTo(0,_top); } });
	    	} 
	    	catch(IllegalArgumentException ex) { }
	    }	 
	} 
	 
	@SuppressWarnings("unchecked") 
	public <T> T findView (int id) {
		return (T)findViewById(id);
	} 
 
    enum ZoomMode {