Activity.RequestOpenInBrowserEducation Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Requests to show the “Open in browser” education.
[Android.Runtime.Register("requestOpenInBrowserEducation", "()V", "", ApiSince=36)]
public void RequestOpenInBrowserEducation();
[<Android.Runtime.Register("requestOpenInBrowserEducation", "()V", "", ApiSince=36)>]
member this.RequestOpenInBrowserEducation : unit -> unit
- Attributes
Remarks
Requests to show the “Open in browser” education. “Open in browser” is a feature within the app header that allows users to switch from an app to the web. The feature is made available when an application is opened by a user clicking a link or when a link is provided by an application. Links can be provided by calling AssistContent#setSessionTransferUri
or AssistContent#setWebUri
.
This method should be utilized when an activity wants to nudge the user to switch to the web application in cases where the web may provide the user with a better experience. Note that this method does not guarantee that the education will be shown.
The number of times that the "Open in browser" education can be triggered by this method is limited per application, and, when shown, the education appears above the app's content. For these reasons, developers should use this method sparingly when it is least disruptive to the user to show the education and when it is optimal to switch the user to a browser session. Before requesting to show the education, developers should assert that they have set a link that can be used by the "Open in browser" feature through either AssistContent#setSessionTransferUri
or AssistContent#setWebUri
so that users are navigated to a relevant page if they choose to switch to the browser. If a URI is not set using either method, "Open in browser" will utilize a generic link if available which will direct users to the homepage of the site associated with the app. The generic link is provided for a limited number of applications by the system and cannot be edited by developers. If none of these options contains a valid URI, the user will not be provided with the option to switch to the browser and the education will not be shown if requested.
Java documentation for android.app.Activity.requestOpenInBrowserEducation()
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.