Code example for TableLayout

Methods: getChildAt

0
    	((Button)randomTableRow.getChildAt(column)).setText(countryName);
    			 
    } 
     
    private TableRow getTableRow(int row) {
    	return (TableRow) buttonTableLayout.getChildAt(row);
    } 
     
    private String getCountryName(String name) {
    	return name.substring(name.indexOf('-') +1).replace('_', ' ');
    } 
     
    private void submitGuess(Button guessButton) {
    	 
    	String guess = guessButton.getText().toString();
    	String answer = getCountryName(correctAnswer);
    	 
    	++totalGuesses;
    	if( guess.equals(answer)) {
    		++correctAnswers;
Contextual code suggestions in your IDE  Get Codota for Java