G greydog Member Licensed User Longtime User Aug 19, 2014 #1 Hi there, I am trying to get my head around intents and how to use them. I have read the tutorial and understand what they do and roughly how to push them around. What I need to go is get this java code snippet I pinched off the internet to run finalIntent intent =newIntent(Intent.ACTION_MAIN); intent.setClassName("com.android.systemui","com.android.systemui.Somnambulator"); startActivity(intent); This should start the daydream if I can get it working. Does anyone know what I need to do to file this intent? Thanks
Hi there, I am trying to get my head around intents and how to use them. I have read the tutorial and understand what they do and roughly how to push them around. What I need to go is get this java code snippet I pinched off the internet to run finalIntent intent =newIntent(Intent.ACTION_MAIN); intent.setClassName("com.android.systemui","com.android.systemui.Somnambulator"); startActivity(intent); This should start the daydream if I can get it working. Does anyone know what I need to do to file this intent? Thanks
K keirS Well-Known Member Licensed User Longtime User Aug 19, 2014 #2 Try this: Code: Copy Dim oIntent As Intent oIntent.Initialize(oIntent.ACTION_MAIN,"") oIntent.SetComponent("com.android.systemui/.Somnambulator") StartActivity(oIntent) Upvote 0
Try this: Code: Copy Dim oIntent As Intent oIntent.Initialize(oIntent.ACTION_MAIN,"") oIntent.SetComponent("com.android.systemui/.Somnambulator") StartActivity(oIntent)
G greydog Member Licensed User Longtime User Aug 20, 2014 #3 Thank you very much, I am a very happy camper Now if I could work out how to call a settings screen.... Problem for another day. Upvote 0
Thank you very much, I am a very happy camper Now if I could work out how to call a settings screen.... Problem for another day.
G greydog Member Licensed User Longtime User Aug 29, 2014 #4 Hi there, This works on a number of my Android boxes, but on some tablets and my phone the button returns an error "an error has occurred in sub: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.systemui.Somnambulator}; have you declared this activity in your AndroidManifest.xml?" I have tried a number of ways of declaring it, but no luck. Do you have any ideas about how I should declare this, and why it works on some devices (with nothing special in the xml file) and not others ? thanks Upvote 0
Hi there, This works on a number of my Android boxes, but on some tablets and my phone the button returns an error "an error has occurred in sub: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.systemui.Somnambulator}; have you declared this activity in your AndroidManifest.xml?" I have tried a number of ways of declaring it, but no luck. Do you have any ideas about how I should declare this, and why it works on some devices (with nothing special in the xml file) and not others ? thanks
G greydog Member Licensed User Longtime User Aug 30, 2014 #5 Nope, I am totally out of ideas. I have looked through all the example java programs I could find to start a daydream and none explicitly define anything in the manifest file for starting daydreams with the code above. Even a simple app with just a button with the code above will fail. I have it working fine on a android 4.4.2 virtual machine I have running on VirtualBox, but it will not execute on a "real" tablet or phone without throwing the error above. This is really frustrating me as it is the last bug I have to fix before I finish my program..... Upvote 0
Nope, I am totally out of ideas. I have looked through all the example java programs I could find to start a daydream and none explicitly define anything in the manifest file for starting daydreams with the code above. Even a simple app with just a button with the code above will fail. I have it working fine on a android 4.4.2 virtual machine I have running on VirtualBox, but it will not execute on a "real" tablet or phone without throwing the error above. This is really frustrating me as it is the last bug I have to fix before I finish my program.....
Kevin Well-Known Member Licensed User Longtime User Aug 30, 2014 #6 I am not too familiar with the daydream feature but I have come across this error in my own apps. What versions of Android is on the devices it fails on? Could it simply be that the daydream feature is not available on those devices? If that's the case then hopefully your app doesn't absolutely need it, otherwise you would have to determine when that feature became available (API level or Android version) and block the non-working devices in your Developer console. As far as preventing the error: Code: Copy Dim oIntent As Intent oIntent.Initialize(oIntent.ACTION_MAIN,"") oIntent.SetComponent("com.android.systemui/.Somnambulator") Try StartActivity(oIntent) Catch ToastMessageShow ("Failed to start DayDream!", True) End Try Upvote 0
I am not too familiar with the daydream feature but I have come across this error in my own apps. What versions of Android is on the devices it fails on? Could it simply be that the daydream feature is not available on those devices? If that's the case then hopefully your app doesn't absolutely need it, otherwise you would have to determine when that feature became available (API level or Android version) and block the non-working devices in your Developer console. As far as preventing the error: Code: Copy Dim oIntent As Intent oIntent.Initialize(oIntent.ACTION_MAIN,"") oIntent.SetComponent("com.android.systemui/.Somnambulator") Try StartActivity(oIntent) Catch ToastMessageShow ("Failed to start DayDream!", True) End Try
G greydog Member Licensed User Longtime User Aug 31, 2014 #7 Hi, thanks for that. Strangely enough if I change the button to bring up the daydream settings screen it works on all devices, but if I try and start the daydream it fails on some??? They are all android 4.3 or later so have daydream on them. I read somewhere the API was experimental and i have found lots of source code for somnambulator that are slightly different, so maybe different vendors have implemented it differently. For now I have just changed to button from starting the daydream to calling up the settings page the letting the user start it from there. If I ever work out how to do it I will update here. Thanks for the help. Upvote 0
Hi, thanks for that. Strangely enough if I change the button to bring up the daydream settings screen it works on all devices, but if I try and start the daydream it fails on some??? They are all android 4.3 or later so have daydream on them. I read somewhere the API was experimental and i have found lots of source code for somnambulator that are slightly different, so maybe different vendors have implemented it differently. For now I have just changed to button from starting the daydream to calling up the settings page the letting the user start it from there. If I ever work out how to do it I will update here. Thanks for the help.
K keirS Well-Known Member Licensed User Longtime User Aug 31, 2014 #8 Is Daydream actually switched on (enabled) for the devices which fail? Upvote 0
G greydog Member Licensed User Longtime User Sep 1, 2014 #9 Yep, there is no difference I can see between them. One device it won't work on is my Samsung Note 3 phone with 4.4.2 installed on it? Upvote 0
Yep, there is no difference I can see between them. One device it won't work on is my Samsung Note 3 phone with 4.4.2 installed on it?