- Home /
Android native popup window
Hi guys,do you have any idea of how to show on android device the native android popup window with a message and yes / no answer?
Thanks
Hi Guys, You can use plugin to show native alert in your unity app/game.
Answer by supernat · May 05, 2014 at 09:28 PM
Android doesn't support modal dialogs, so it would involve adding an activity or using the dialog builder. In both cases, you'll need to write the java code to display and handle the response.
Here is a link for the dialog builder code. http://stackoverflow.com/questions/2115758/how-to-display-alert-dialog-in-android
You can use the Unity API in java to send a message back to Unity when the response is received: http://forum.unity3d.com/threads/109895-Java-plugin-how-do-you-send-a-message-from-Java-to-Unity
You can use the JNI Helper to call the Java method to display the dialog, from within Unity script: http://docs.unity3d.com/Documentation/ScriptReference/AndroidJNIHelper.html
You will use the Helper with the AndroidJavaObject and AndroidJavaClass classes to make calls into the java side. It is a nasty system, but it works. If you have a few bucks and no time, just get a plugin. I use the Prime31 etcetera (I think) plugin which has an ability to display an alert dialog with results.
Answer by tvranjith · Feb 10, 2015 at 12:58 PM
May be this post might be useful for you http://chikkooos.blogspot.jp/2015/02/accessing-android-or-java-classes-from.html
Answer by Voxel-Busters · Jun 08, 2015 at 07:30 AM
Pretty sure that you would have found a solution by now. You need to write an android plugin for that incase if you want native features. there is no option availability on Unity directly.
But would like to suggest our free plugin Cross Platform Native Plugins which can be useful to others who want to access native popups like Alert Dialogs, Prompt Dialogs.
Answer by AtifatGamy · Dec 07, 2018 at 09:17 AM
try this...
for android... https://assetstore.unity.com/packages/tools/integration/wrp-dialog-box-and-toast-for-android-13089
for IOS... https://assetstore.unity.com/packages/tools/integration/wrp-ios-alert-dialog-message-13604
Your answer
Follow this Question
Related Questions
Destroy Object then pop-up other small window question. 1 Answer
Popup opened by event. Android 0 Answers
Popup window 0 Answers
How can I get a popup window to follow the cursor? 0 Answers
Muting application during phonecall on Android(Call Popup) 3 Answers