Search:

Type: Posts; User: TP-Oreilly

Page 1 of 4 1 2 3 4

Search: Search took 0.07 seconds.

  1. Replies
    2
    Views
    1,518

    Re: Polymorphism.

    So polymorphism is the act of inheriting a class and overriding methods from it/adding to it, so making a class based on another. And as polymorphism means many forms, we call this polymorphism...
  2. Replies
    2
    Views
    1,518

    Polymorphism.

    Hi,

    Im just trying to get the right idea about polymorphism.

    Is polymorphism simply the act of inheriting an abstract class and defining the methods yourself. As polymorphism means many forms,...
  3. Replies
    2
    Views
    1,332

    Re: equals() method.

    Thanks. :)
  4. Replies
    2
    Views
    1,332

    equals() method.

    Hi, in my code I have


    public boolean equals(Object obj) {
    if (this.equals(obj)){
    return true;
    }
    return false;
    }
  5. Re: My app audio sounds different when running the app?

    I found out why....

    The format of the sound file was .wav, i changed it to a .mp3 and now it sounds as it should.
  6. My app audio sounds different when running the app?

    Hi,

    I have:


    final MediaPlayer mp = MediaPlayer.create(this, R.raw.popping_sound_effect);


    When I play the sound file it is how I want it to be, but when I run the app and making the...
  7. Replies
    4
    Views
    2,006

    Re: MediaPlayer.

    I got it working now, just to let you know why it wasnt working:

    I changed this:



    public class BackgroundService extends Service{

    @Override
    public IBinder onBind(Intent intent) {
  8. Replies
    4
    Views
    2,006

    Re: MediaPlayer.

    Ive created a service which plays the audio, but still when i change the layout on the activity the audio stops?
  9. Replies
    4
    Views
    2,006

    Re: MediaPlayer.

    I cant because I have set it so that when I click on a button the this is called: setContentView(R.layout.menu_screen);

    I tried making a different activity for the menu_screen.xml layout but when...
  10. Replies
    4
    Views
    2,006

    MediaPlayer.

    Hi,

    Why does my MediaPlayer stop when I change the layout?




    MediaPlayer mp = MediaPlayer.create(this, R.raw.background_song);
    mp.setLooping(true);
    mp.start();
  11. Thread: Activities.

    by TP-Oreilly
    Replies
    4
    Views
    2,117

    Re: Activities.

    To answer my own question............ What I'm actually doing is setting the content of the tab as an Activity???
  12. Thread: Activities.

    by TP-Oreilly
    Replies
    4
    Views
    2,117

    Re: Activities.

    This is what made me think that each activity is a different window:

    "An activity is the equivalent of a Frame/Window in GUI toolkits. It takes up the entire drawable area of the screen"
  13. Thread: Activities.

    by TP-Oreilly
    Replies
    4
    Views
    2,117

    Re: Activities.

    I do have an understanding of Java. It's concept of an Activity which is confusing me. Reading different things on the internet have made me confused.
  14. Thread: Activities.

    by TP-Oreilly
    Replies
    4
    Views
    2,117

    Activities.

    Hello, I'm trying to understand what exactly is happening in my code. Thanks in advance for replying, I'm pretty confused and need some help. I have read many things on the internet but i havnt found...
  15. Replies
    6
    Views
    2,766

    Re: Hello World Android App

    Thank you very much for your detailed reply.
  16. Replies
    6
    Views
    2,766

    Re: Hello World Android App

    I ask this because I havnt actually created an instance of my class so how can I be referring to an INSTANCE of my HelloAndroidActivity class?
  17. Replies
    6
    Views
    2,766

    Re: Hello World Android App

    Thanks for the reply. I also have another question, and as it is regarding this code I thought I'd ask it in this thread.

    I know that the constructor of the TextView class requires a Context...
  18. Replies
    6
    Views
    2,766

    Hello World Android App

    Hello, I following a "Hello World" tutorial for android development and I want to understand how the code works exactly, instead of just using it without understanding it, heres the code:

    ...
  19. Replies
    8
    Views
    1,629

    Re: Extending class

    Thank you :)
  20. Replies
    8
    Views
    1,629

    Re: Extending class

    Got it, thank you :)
  21. Replies
    8
    Views
    1,629

    Re: Extending class

    Thank you very much for your detailed reply, much appreciated.

    So, when i create an instance of my class which has extended JFrame, both my class constructor and the JFrame constructor is called...
  22. Replies
    8
    Views
    1,629

    Re: Extending class

    I would understand how it all works if our class also inherits JFrame's constructor, if not then I can not see how creating an instance of our class creates a window.
  23. Replies
    8
    Views
    1,629

    Extending class

    Hi, I know when we extend a class our class gets all of the properties of the class we extend.

    I am abit confused. I have read that when our class extends the JFrame class, our class then IS the...
  24. Replies
    5
    Views
    2,936

    Re: keyPressed method not working?

    Ah thank you, ive now got it to compile but it doesnt work.

    I have to defined all of the methods of the KeyListener interface. I have removed the "if (keyCode == KeyEvent.VK_ESCAPE){" and just put...
  25. Replies
    5
    Views
    2,936

    Re: keyPressed method not working?

    This is my code, it is only small:



    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;

    class MoveIcon implements KeyListener{
Results 1 to 25 of 89
Page 1 of 4 1 2 3 4