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
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Hello World!" | |
android:id="@+id/nombre_usuario"/> |
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
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<EditText | |
android:layout_width="match_parent" | |
android:layout_height="40dp" |
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
EditText et_nombre = findViewById(R.id.et_nombre); | |
Button button = findViewById(R.id.button_enviar_nombre); |
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
button.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
} | |
}); |
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
Toast.makeText(MainActivity.this, “mensaje que quieres mostrar”, Toast.LENGTH_SHORT).show(); |
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
button.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
String nombre = String.valueOf(et_nombre.getText()); | |
Toast.makeText(MainActivity.this, “El nombre que has ingresado es : “+nombre, Toast.LENGTH_SHORT).show(); | |
} | |
}); |
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
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:src="@mipmap/ic_launcher" | |
/> |
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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_login); | |
Intent mainActivityIntent = new Intent(this, MainActivity.class); | |
startActivity(mainActivityIntent); | |
} |
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
//Creamos el Intent | |
Intent sendIntent = new Intent(); | |
//Le indicamos la accion a realizar en este caso enviarla o compartirla | |
sendIntent.setAction(Intent.ACTION_SEND); | |
//Le decimos el tipo, en nuestro caso un texto plano | |
sendIntent.setType("text/plain"); | |
//Le agregamos el texto que queremos que contenga | |
sendIntent.putExtra(Intent.EXTRA_TEXT, "Visita codingpizza.com"); | |
//Verificamos que el intent se va a mostrar en un activity | |
if (sendIntent.resolveActivity(getPackageManager()) != null) { |
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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_login); | |
Intent mainActivityIntent = new Intent(this, MainActivity.class); | |
mainActivityIntent.putExtra("url","www.codingpizza.com"); | |
startActivity(mainActivityIntent); | |
} |
OlderNewer