Dim i As Intent
i.Initialize (i.ACTION_MAIN ,"")
i.AddCategory ("android.intent.category.HOME")
i.Flags =0x3400000
i.SetComponent ("android/com.android.internal.app.ResolverActivity")
StartActivity(i)
Upon exiting, you can use something like thisB4X:Dim i As Intent i.Initialize (i.ACTION_MAIN ,"") i.AddCategory ("android.intent.category.HOME") i.Flags =0x3400000 i.SetComponent ("android/com.android.internal.app.ResolverActivity") StartActivity(i)
But this will get user to a popUp selection screen, so not sure if this can be useful in your case.
Sub Activity_Create(FirstTime As Boolean)
Dim i As Intent
i.Initialize (i.ACTION_MAIN ,"")
i.AddCategory ("android.intent.category.HOME")
i.Flags =0x3400000
i.SetComponent ("android/com.android.internal.app.ResolverActivity")
StartActivity(i)
......
I worked but how to remove it.NO, nothing wrong. I forgot to tell you to add the following to your manifest file (from b4a choose manifest editor):
AddActivityText("main",
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>)
[/code]
Now, you can try this, but please notice that initially user has to choose your app as a home screen app.
No, i want to register application on home key till app is running and unregister when it is closed.What do you mean? Upon exiting the app, use the previous code in order that the user decides whether to have the normal android's launcher or yours. Usually, I do this by setting an 'admin' password, upon exiting the app.
Try the code I posted here:
http://www.b4x.com/forum/basic4andr...ials/10839-android-kiosk-mode-tutorial-6.html (post #58)
ACL....if i am using it with your code which you posted in thread only then.Which error do you get?