-3

I've started a bit with android development, and for my first assigment I've decided to make soundboard. Ive successfully added several buttons, and they make a sound on click. Currently when you open application it directly opens Animal Soundboard.

What I want to do next is: When you start application that it offers you:

Animal Sounds Laugh Sounds etc...

When you click on some of them, so it opens Animal sounds?

Basically I need help with how to code when you click on button that opens new windows with new buttons.

Mark
  • 2,380
  • 11
  • 29
  • 49
Sn1p3r
  • 3
  • 1
  • 1
  • 4
  • 1
    This site is for specific problems only, not all-in-one solutions: http://stackoverflow.com/tour – Blacklight Oct 29 '14 at 12:14
  • http://stackoverflow.com/questions/736571/using-intent-in-an-android-application-to-show-another-activity – Naufal Oct 29 '14 at 12:15
  • 1
    First thing you have to do is go through this http://developer.android.com/guide/index.html – Praveena Oct 29 '14 at 12:15
  • I'm so sorry, I did research but it didn't gave me what I needed. Only thing I needed was how to start new activity (open new window) but I explained entire situation so you guys know what I'm building. – Sn1p3r Oct 29 '14 at 18:51

2 Answers2

1

this link should be useful here

You want to create Activity and start it after button click

button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
    Intent intent = new Intent(this, YourActivityName.class);
    startActivity(intent);
} 
});
Community
  • 1
  • 1
Karol Żygłowicz
  • 2,442
  • 2
  • 26
  • 35
0

In Android, the Windows you are referring to are called Activities( or Fragments, in some scenarios). On a button click, you can launch a new Activity using Intents.

You can learn how to do that here : http://developer.android.com/training/basics/firstapp/starting-activity.html

vkm
  • 548
  • 7
  • 23