mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-06-18 23:20:57 +00:00
added the malware notification popup window
This commit is contained in:
parent
9dd98a8ab7
commit
5773bba24c
1 changed files with 12 additions and 3 deletions
|
@ -120,7 +120,16 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
// Create and show a pop-up dialog
|
||||||
|
new AlertDialog.Builder(this)
|
||||||
|
.setTitle("Important notice")
|
||||||
|
.setMessage("Hello, I'm Malware, proceed with caution")
|
||||||
|
.setPositiveButton("OK", (dialog, which) -> {
|
||||||
|
// Code to execute when OK is clicked
|
||||||
|
dialog.dismiss();
|
||||||
|
})
|
||||||
|
.setCancelable(false) // if you want to make the dialog not cancellable
|
||||||
|
.show();
|
||||||
// Create notification channel for API 26+
|
// Create notification channel for API 26+
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
CharSequence name = getString(R.string.name);
|
CharSequence name = getString(R.string.name);
|
||||||
|
@ -135,8 +144,8 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
||||||
// Create and show the notification
|
// Create and show the notification
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "my_channel_id")
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "my_channel_id")
|
||||||
.setSmallIcon(R.drawable.app_icon) // Replace with your icon
|
.setSmallIcon(R.drawable.app_icon) // Replace with your icon
|
||||||
.setContentTitle("Virus")
|
.setContentTitle("Important notice")
|
||||||
.setContentText("Hello im Malware")
|
.setContentText("Hello I'm Malware, proceed with caution")
|
||||||
.setPriority(NotificationCompat.PRIORITY_DEFAULT);
|
.setPriority(NotificationCompat.PRIORITY_DEFAULT);
|
||||||
|
|
||||||
NotificationManager notificationManager = null;
|
NotificationManager notificationManager = null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue