Created
September 6, 2017 16:35
-
-
Save brunoazevedomendonca/930cc6895da1dbce9ea54d8d5f6f0caf to your computer and use it in GitHub Desktop.
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:id="@+id/txTexto" | |
android:textSize="30sp" | |
android:layout_margin="16dp"/> | |
</LinearLayout> |
This file contains 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
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
exibe("Hello World!"); | |
} | |
private void exibe(String texto){ | |
TextView textView = (TextView) findViewById(R.id.txTexto); | |
textView.setText(texto); | |
} | |
private void exibe(int numero){ | |
exibe(String.valueOf(numero)); | |
} | |
private void exibe(double numero){ | |
exibe(String.valueOf(numero)); | |
} | |
private void exibe(float numero){ | |
exibe(String.valueOf(numero)); | |
} | |
private void exibe(char letra){ | |
exibe(String.valueOf(letra)); | |
} | |
private void exibe(boolean condicao){ | |
exibe(String.valueOf(condicao)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment