Why i am loosing the focus on my input and i no longer get suggestions from my autofill service if i click on a button on remote views?

I am developing an autofill service, it is working well if i use simple remote views for suggestions. If i click on one of the remote views suggested, it fill the input of my external application. And i still get suggestion whenever i click on the input. So my autofill service keeps working.

However if i add some button to remote views, and i click on that button, i no longer get any suggestions from my autofill service. Its like the autofill service is no longer working.

Here is my autoFillRequest funtion, using pending intent.

@Override
    public void onFillRequest(FillRequest request, CancellationSignal cancellationSignal, FillCallback callback) {
        RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.autofill_suggestion_interactive);
        remoteViews.setTextViewText(R.id.value, "Suggested Text");
        remoteViews.setImageViewResource(R.id.icon, R.drawable.ic_autofill);

        Intent intent = new Intent(this, ButtonActionReceiver.class);
        intent.putExtra("EXTRA_INFO", "Additional Info");
        PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE);

        remoteViews.setOnClickPendingIntent(R.id.action_button, pendingIntent);

        Dataset dataset = new Dataset.Builder(remoteViews)
            .setValue(findViewById(R.id.autofill_field).getAutofillId(), AutofillValue.forText("Suggested Text"))
            .build();

        FillResponse response = new FillResponse.Builder()
            .addDataset(dataset)
            .build();

        callback.onSuccess(response);
    }

And this is the button action receiver:

@Override
    public void onReceive(Context context, Intent intent) {
        String data = intent.getStringExtra("EXTRA_INFO");
        AutoDataset dataset =  new Gson().fromJson(data, AutoDataset.class);
        Log.e("ButtonActionReceiver", "info: " + dataset.getPackageName());
        Intent serviceIntent = new Intent(context, FloatingDialogService.class);
        serviceIntent.putExtra("EXTRA_DATA", data);
        context.startService(serviceIntent);
    }

this opens me a floating dialog where i need to put some text, do some execution, and then close it.

After closing the floating popup, i need to get the autofill suggestions again, but i no longer have them.

I tried to request the autofill again manually, but it doesn’t work.

Below is my approach to call manually the autofill service again:

From my floating popup i am calling a broadcast like this:

                Intent fillRequestIntent = new Intent("my request to autofill again");
                sendBroadcast(fillRequestIntent);
                stopSelf(); // Stop the service and remove the floating view

And my broadcast receiver is like this:

public void onReceive(Context context, Intent intent) { 
        if (intent != null && "my request to autofill again".equals(intent.getAction())) {
            Log.d(TAG, "Received new fill request broadcast");
            AutoFillServiceImpl myAutofillService = new AutoFillServiceImpl();
            myAutofillService.requestNewFill();

        }
    }

Below is the implementation of the requestNewFill function in my autofill service:

    @Override
    public void onConnected() {
        super.onConnected();
        AppLog.e(TAG, "Autofill Service connected");
    }

    public void requestNewFill() {
        AppLog.e(TAG, "Request New Fill");
        onCreate();
        onConnected();
    }

    @Override
    public void onCreate() {
        super.onCreate();
        AppLog.e(TAG, "Autofill Service created");
        mAutoPreferences = AutoPreferences.getInstance(this);
        mUserId = (int) mAutoPreferences.getUserId();
        mDatabaseHelper = new DatabaseHelper(this);

    }

So, how i can fix that, to get the autofill suggestions again ?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật