Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor manojkumar.m's Avatar
    Join Date
    Jan 2008
    Posts
    272
    Hi,

    I am writing a player application.

    For that I am using input stream.

    My code looks like this:
    try
    {
    Fileconnection fc = (FileConnection)Connector.open(mediafileLoc);
    InputStream is = fc.openInputStream();
    Player p = Manager.createPlayer(is,null);
    p.prefetch();
    p.realize();
    p.start();
    }
    catch(Exception e)
    {
    //showing alert
    }

    its working fine on first time. when I closed and tried to play the same song I got an exception:"File is used by the application".
    When closing the player I wrote like this:
    try
    {
    p.closePlayer();
    is.close();
    is = null;
    fc.close();
    fc = null;
    }

    catch(Exception e)
    {
    //showing alert
    }


    What might be the problem?

    can you please help me.

    Thanks,
    Manoj.

  2. #2
    Nokia Developer Champion jappit's Avatar
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,391
    Uhm...

    are you sure you're not getting an Exception when trying to close your Player/Stream/FileConnection instances?

    Since you define all these instances locally to your previous try/catch block, they're not accessible from outside it (and this should be the reason of your error message).

    Hope it helps,
    Pit

  3. #3
    Regular Contributor manojkumar.m's Avatar
    Join Date
    Jan 2008
    Posts
    272
    hi Jappit,

    Thanks for your reply.

    The problem get resolved.

    Thanks,
    Manoj.

Similar Threads

  1. problem in reading from bluetooth inputstream
    By aluckybird in forum Bluetooth Technology
    Replies: 13
    Last Post: 2010-05-17, 15:53
  2. Problem in creating image from InputStream
    By deepanjanghosh16 in forum Mobile Java General
    Replies: 1
    Last Post: 2006-12-19, 12:47
  3. About 6230 Bt Problem
    By eerkek in forum Bluetooth Technology
    Replies: 17
    Last Post: 2005-02-08, 12:33
  4. Inputstream read method is blocking
    By gnhansen in forum Bluetooth Technology
    Replies: 0
    Last Post: 2004-09-29, 14:44
  5. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved