Jad Joubran
Jad Joubran

Reputation: 2579

How to create a white Alert on Android using PhoneGap?

I want to show a popup similar to this one on Android using PhoneGap.Is this a native popup? or is it designed by Twitter?

I can't find its name on the internet

Using JavaScript:alert and navigator.notification.alert(message, alertCallback, [title], [buttonName]) shows the default black dialog.

White Popup

Upvotes: 3

Views: 1670

Answers (1)

caiocpricci2
caiocpricci2

Reputation: 7798

That is the native dialog from the Light Holo Theme, twitter definitely hasn't built that. You just need to set the correct theme for your app. You can't do that on the HTML5 layer, but it's very easy to set in your manifest.

Assuming that you are running on any device with android 3.0 or higher you can set up your app theme to Holo.Light in your manifest file:

And if you want to target lower versions you can take a look on this question.

And don't use javacript.alert(), that will display an ugly title in your dialog, always use phonegap notification for native dialogs.

Upvotes: 4

Related Questions