@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AutofillManager af=getSystemService(AutofillManager.class);
if (af.isAutofillSupported()) {
if (af.hasEnabledAutofillServices()) {
Toast.makeText(this, R.string.msg_ready, Toast.LENGTH_LONG).show();
finish();
}
else {
Uri uri=Uri.parse("package:"+getPackageName());
Intent i=new Intent(Settings.ACTION_REQUEST_SET_AUTOFILL_SERVICE, uri);
startActivityForResult(i, REQUEST_ID);
}
}
else {
Toast.makeText(this, R.string.msg_not_supported, Toast.LENGTH_LONG).show();
finish();
}
}