Last active
January 3, 2017 06:49
-
-
Save prasad091/5ce09300f253583328e235c7d7fb4b66 to your computer and use it in GitHub Desktop.
Alert Dialog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kgislias.messenger; | |
import android.support.v7.app.AlertDialog; | |
import android.support.v7.app.AppCompatActivity; | |
/** | |
* Created by admin on 03-01-2017. | |
*/ | |
public class AlertBuild extends AppCompatActivity{ | |
public void onErrorDialog(String title,String message){ | |
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.MyAlertDialogStyle); | |
builder.setTitle(title); | |
builder.setMessage(message); | |
builder.setPositiveButton("OK", null); | |
builder.setNegativeButton("Cancel", null); | |
builder.show(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style name="MyAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert"> | |
<!-- Used for the buttons --> | |
<item name="colorAccent">@color/white</item> | |
<!-- Used for the title and text --> | |
<item name="android:textColorPrimary">#FFFFFF</item> | |
<!-- Used for the background --> | |
<item name="android:background">#4CAF50</item> | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment