Sie sind auf Seite 1von 2

package com.example.

animalsound;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.media.MediaPlayer;
import android.view.Menu;
import android.widget.Button;
import android.widget.TextView;
public class Abeja extends Activity {
MediaPlayer mp;
MediaPlayer abeja;
MediaPlayer ingles;
MediaPlayer maya;
TextView textEspanol;
TextView txtIngles;
TextView textmaya;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.abeja);
textEspanol=(TextView)findViewById(R.id.textEspanol);
txtIngles=(TextView)findViewById(R.id.txtIngles);
textmaya=(TextView)findViewById(R.id.textmaya);
}
public void Abeja (View v)
{
textEspanol.setText("Abeja");
MediaPlayer abeja=MediaPlayer.create(this,R.raw.abejaespanol);
abeja.start();
textmaya.setText("");
txtIngles.setText("");
}
public void Abejaingles(View v)
{
textmaya.setText("");
textEspanol.setText("");
txtIngles.setText("Bee");
MediaPlayer ingles=MediaPlayer.create(this,R.raw.abejaingles);
ingles.start();
}
public void maya(View v)
{
textEspanol.setText("");
txtIngles.setText("");
textmaya.setText("Kaab");
MediaPlayer maya=MediaPlayer.create(this,R.raw.abejamaya);
maya.start();
}
public void presion(View view)
{
MediaPlayer mp=MediaPlayer.create(this,R.raw.avispa);
mp.start();
}
public void cerrar(View view)
{
finish();
}
}
________________________________________
<TextView
android:id="@+id/textEspanol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/grillopausa"
android:layout_centerHorizontal="true"
android:layout_marginBottom="100dp"
android:textSize="50dp" />
<TextView
android:id="@+id/txtIngles"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textEspanol"
android:layout_alignBottom="@+id/textEspanol"
android:layout_centerHorizontal="true"
android:textSize="50dp" />
<TextView
android:id="@+id/textmaya"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textEspanol"
android:layout_alignBottom="@+id/textEspanol"
android:layout_centerHorizontal="true"
android:textSize="50dp" />
______________________________
caballo
horse
Tsimin

Das könnte Ihnen auch gefallen