Android Question Releasing Starting Intent - Lock?

Discussion in 'Android Questions' started by Robert Valentino, Feb 13, 2015.

  1. Robert Valentino

    Robert Valentino Well-Known Member Licensed User

    I finally have my program registered as the default app when a MP3 file is click but have come across another problem.

    I am using a Samsung S3.

    When I go into "My Files" explorer and click on a MP3 file it starts my App and my app starts playing the song.

    If I then click on Home button (music keeps playing as it should) and then click on the "My Files" explorer Icon it jumps right to my program.

    It seems that because the "My Files" explorer program started my program we are kind of linked together.

    How do I break this link (without exiting my program) so that I could select another file to play or do something else with "My Files" explorer?

    Even after the song is done playing I am still locked to the "My Files" explorer.

    Once I exit my program I return back to the "My Files" explorer exactly where I was?

    Thanks
    BobVal
     
  2. Robert Valentino

    Robert Valentino Well-Known Member Licensed User

    From what I can find I need to return a result intent.

    But I cannot seem to return a result intent without Finishing the program.

    Anyway I can return a result intent and keep the program active?
     
  3. Robert Valentino

    Robert Valentino Well-Known Member Licensed User

    Code:
    Dim ResultIntent As Intent
              
            ResultIntent.Initialize(
    "com.BOBs.RESULT_ACTION""")
            ResultIntent.PutExtra(
    "Result", -1)
            
                   
    Dim MyPhone As Phone
           
                  MyPhone.SendBroadcastIntent(ResultIntent)
    Seems creating and broadcasting a intent with a result of -1 makes everyone happy.
     
  4. Robert Valentino

    Robert Valentino Well-Known Member Licensed User

    Strike what I said above. It turns out just by have the below line in my Manifest solved the problem

    SetActivityAttribute(Main, android:launchMode, "singleInstance")
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice