I want to create an alertdialog outside of my application.
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(Config_ConstantVa
I am using the same functionality in my app where i used one activity as a pop up message like below
@Override
public void onReceive(Context context, Intent intent) {
try {
Bundle bundle = intent.getExtras();
String message = bundle.getString("alarm_message");
Intent newIntent = new Intent(context, PopupActivity.class);
newIntent.putExtra("alarm_message", message);
newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(newIntent);
} catch (Exception e) {
e.printStackTrace();
}
}
In the Popup Activity design the UI like the dialog box and add this in Android Manifest.xml
<activity android:name=".PopupActivity"
android:theme="@android:style/Theme.Dialog"
android:label="@string/label"
></activity>
You can customise the UI based on your specification.Its working perfectly for me. I hope it helps.