Robert Valentino Well-Known Member Licensed User Longtime User Mar 4, 2016 #1 how do I return a javaobject of the type AudioManager I need to get back AudioManager so I can pass it into a routine to create a RemoteControlClient B4X: Dim jo As JavaObject Dim joAudioManager As JavaObject jo.InitializeContext joAudioManager = jo.RunMethod("GetAudioManager", Null) #If JAVA import android.app.PendingIntent; import android.content.*; import android.media.*; import android.media.RemoteControlClient; public AudioManager GetAudioManager { AudioManager mAudioManager; mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); return mAudioManager; } #end if I've tried B4X: public JavaObject GetAudioManager Public JavaObject GetAudioManager(void) Public GetAudioManager(void) as JavaObject ALL fail at compile time BobVal
how do I return a javaobject of the type AudioManager I need to get back AudioManager so I can pass it into a routine to create a RemoteControlClient B4X: Dim jo As JavaObject Dim joAudioManager As JavaObject jo.InitializeContext joAudioManager = jo.RunMethod("GetAudioManager", Null) #If JAVA import android.app.PendingIntent; import android.content.*; import android.media.*; import android.media.RemoteControlClient; public AudioManager GetAudioManager { AudioManager mAudioManager; mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); return mAudioManager; } #end if I've tried B4X: public JavaObject GetAudioManager Public JavaObject GetAudioManager(void) Public GetAudioManager(void) as JavaObject ALL fail at compile time BobVal
Robert Valentino Well-Known Member Licensed User Longtime User Mar 4, 2016 #2 Found this: https://www.b4x.com/android/forum/t...-setwireddeviceconnectionstate.62668/#content This will do but still need to learn how to return a type of other java calls Can someone show me a prototype statement Upvote 0
Found this: https://www.b4x.com/android/forum/t...-setwireddeviceconnectionstate.62668/#content This will do but still need to learn how to return a type of other java calls Can someone show me a prototype statement
Robert Valentino Well-Known Member Licensed User Longtime User Mar 4, 2016 #3 Finally figured it out public AudioManager MakeAudioManager() { AudioManager mAudioManager; mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); return mAudioManager; } Upvote 0
Finally figured it out public AudioManager MakeAudioManager() { AudioManager mAudioManager; mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); return mAudioManager; }