Android Question set Full Screen Intent

aads

New Member
Hello
i am looking for making a full screen notification on phone , like whatsapp caller id (even on locked screen)
after make some searchs on forum i understand there is premission requiment for andoird >9 , fine.

i found this code in java , how can i use this in my firebase notification service.
i got severals errors for "AnActivity.class" , i try any class and activity names , but still error.


please lets do this , i belive this is a usufull option for b4a users.
Best



firebasemessaging.java:275: error: cannot find symbol
Intent intent = new Intent(this, AnActivity.class);
^
symbol: class AnActivity
location: class firebasemessaging



B4X:
Private NativeMe As JavaObject
        NativeMe.InitializeContext
        NativeMe.RunMethod("FirstMethod", Null)
        Log("dad")
        
        
        
        
#If JAVA
import android.content.Intent;
        
            public void FirstMethod() {
              
                   Intent intent = new Intent(this, AnActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this,
        REQ_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification notification = new NotificationCompat.Builder(this, Constants.CHANNEL_ID)
        .setSmallIcon(R.drawable.ic_launcher_foreground)
        .setContentTitle("Incoming call")
        .setContentText("(919) 555-1234")
        .setPriority(NotificationCompat.PRIORITY_HIGH)
        .setCategory(NotificationCompat.CATEGORY_ALARM)
        //Send notice to start Activity
        .setFullScreenIntent(pendingIntent, true)
        .build();
NotificationManager manager = getSystemService(NotificationManager.class);
manager.notify(10, notification);
              
              
            }
#End If
 
Top