• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

A question about getRecommendedTimeoutMillis method in AccessibilityManager class

Tommy Kim

Lurker
Jun 8, 2019
1
0
Hello.
In order to test getRecommendedTimeoutMillis method with FLAG_CONTENT_CONTROLS in AccessibilityManager class, I created snackBar.
FLAG_CONTENT_CONTROLS method is android Q API that control timeout function within accessibility service is enabled.
In other words, if default snackBar set to show short, the snackBar is disappeared very shortly.
But if I use snakBar with getRecommendedTimeoutMillis method, once accessibility service such as TalkBack is enabled, blind users can interact with snackBar with more easily.
Because I have Pixel 2 and enrolled android Q beta, I can test new API.
By the way, within my snackBar, I really don't know how to apply getRecommendedTimeoutMillis method to my snackBar.
Actually I'm really new to java, could you help me?
If you can write code include my snackBar code with getRecommendedTimeoutMillis method, I can copy it, past, and test.
My snackBar code is below.

public void snackbarWithAction(View view){
Snackbar snackbar = Snackbar.make(coordinatorLayout,"Snackbar With Action",Snackbar.LENGTH_SHORT);
snackbar.setAction("UNDO", new View.OnClickListener() {
@override
public void onClick(View view) {
Toast.makeText(getApplicationContext(),"Undo action",Toast.LENGTH_SHORT).show();
}
});
snackbar.show();
}

Thank you so much in advance.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones