Created
June 22, 2017 19:53
-
-
Save anonymous/2d21defdba61c2589ac732b8d638d91e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pedrogouveia.teste1; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.TextView; | |
import org.w3c.dom.Text; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
//reference to xml widgets | |
TextView FishText = (TextView) findViewById(R.id.FishText); | |
TextView DogText = (TextView) findViewById((R.id.DogText)); | |
Button ChangeNameButton = (Button) findViewById(R.id.ChangeNameButton); | |
final String animais[] = new String[5]; | |
} | |
public void ChangeFish(){ | |
String [] animais = {"Dog","Cat","Rat","Horse","Mouse"}; | |
final TextView FishText = (TextView) findViewById(R.id.FishText); | |
for(int contador = 0;contador<5;contador++) { | |
FishText.setText(animais[contador]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment