I want to show a dialog from receiver. So, I started an activity with transparent background and displays a dialog. Below is my class.
public class DialogDisplayingActivity extends Activity{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(....);
showDialog();
}
private void showDialog()
{
final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
// Include dialog.xml file
dialog.setContentView(R.layout.dialoglayout);
// Set dialog title
.........................
............................
dialog.show();
}
}
In my receiver class, I start the activity as shown below:
Intent intent = new Intent(context, SendingPermissionActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("details", value);
context.startActivity(intent);
The issue is --> suppose if the first dialog is shown at 8.45am and user doesn't dismiss it and if the receiver receives another command to show the dialog at 8.46 am, it doesn't show up. The control is not coming to DialogDisplayingActivity
at all. But I want to display dialogs as many times as the receiver receives i.e., I need to start activities that many times. Can someone suggests me to achieve this?
Manifest.xml:
<activity
android:name="com.example.note.DialogDisplayingActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:taskAffinity=""
android:excludeFromRecents="true">
</activity>