Code example for ScrollView

Methods: addViewsetFillViewport

0
	private ScrollView scrollView;
	 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        scrollView = new ScrollView(this);
        scrollView.setFillViewport(true);
		try { 
			scoreView = new ScoreView(this, retrieveOrCreateScore());
		} catch (RecordNotFoundException e) {
			// TODO: What should happen here? Can't find the score in the database. Display error 
		} 
		scrollView.addView(scoreView);
		setContentView(scrollView);
        scoreView.requestFocus();
	} 
	 
	private Score retrieveOrCreateScore() throws RecordNotFoundException { 
		Bundle extras = getIntent().getExtras();
        Integer scoreId = (extras != null) ? extras.getInt(Constants.SCORE_ID) : null;
Experience pair programming with AI  Get Codota for Java