AppManager
public
class
AppManager
extends Object
java.lang.Object | |
↳ | com.google.android.libraries.car.app.AppManager |
Manages the communication between the app and the host.
Summary
Public methods | |
---|---|
void
|
invalidate()
Requests the current template to be invalidated, which eventually triggers a call to |
void
|
setSurfaceListener(SurfaceListener surfaceListener)
Sets the |
void
|
showToast(CharSequence text, int duration)
Shows a toast on the car screen. |
Inherited methods | |
---|---|
Public methods
invalidate
public void invalidate ()
Requests the current template to be invalidated, which eventually triggers a call to Screen.getTemplate()
to get the new template to display.
Throws | |
---|---|
HostException |
if the remote call fails. |
setSurfaceListener
public void setSurfaceListener (SurfaceListener surfaceListener)
Sets the SurfaceListener
to get changes and updates to the surface on which the app can
draw custom content, or null
to reset the listener.
This call requires the com.google.android.libraries.car.app.ACCESS_SURFACE
permission to be declared.
The Surface
can be used to draw custom content such as a navigation app's map.
Parameters | |
---|---|
surfaceListener |
SurfaceListener |
Throws | |
---|---|
SecurityException |
if the app does not have the required permissions to access the surface. |
HostException |
if the remote call fails. |
showToast
public void showToast (CharSequence text, int duration)
Shows a toast on the car screen.
Parameters | |
---|---|
text |
CharSequence : the text to show. |
duration |
int : how long to display the message. |
Throws | |
---|---|
HostException |
if the remote call fails. |