Android
android.view
public class

android.view.ViewDebug

java.lang.Object
android.view.ViewDebug

Various debugging/tracing tools related to View and the view hierarchy.

Nested Classes
ViewDebug.ExportedProperty This annotation can be used to mark fields and methods to be dumped by the view server. 
ViewDebug.HierarchyTraceType Defines the type of hierarhcy trace to output to the hierarchy traces file. 
ViewDebug.IntToString Defines a mapping from an int value to a String. 
ViewDebug.RecyclerTraceType Defines the type of recycler trace to output to the recycler traces file. 

Summary

Constants

      Value  
boolean  TRACE_HIERARCHY  Enables or disables view hierarchy tracing.  false 
boolean  TRACE_RECYCLER  Enables or disables view recycler tracing.  false 

Public Constructors

            ViewDebug()

Public Methods

      static    void  startHierarchyTracing(String prefix, View view)
Starts tracing the view hierarchy of the specified view.
      static    void  startRecyclerTracing(String prefix, View view)
Starts tracing the view recycler of the specified view.
      static    void  stopHierarchyTracing()
Stops the current view hierarchy tracing.
      static    void  stopRecyclerTracing()
Stops the current view recycer tracing.
      static    void  trace(View view, ViewDebug.RecyclerTraceType type, int[] parameters)
Outputs a trace to the currently opened recycler traces.
      static    void  trace(View view, ViewDebug.HierarchyTraceType type)
Outputs a trace to the currently opened traces file.
Methods inherited from class java.lang.Object

Details

Constants

public static final boolean TRACE_HIERARCHY

Enables or disables view hierarchy tracing. Any invoker of trace(View, android.view.ViewDebug.HierarchyTraceType) should first check that this value is set to true as not to affect performance.
Constant Value: false

public static final boolean TRACE_RECYCLER

Enables or disables view recycler tracing. Any invoker of trace(View, android.view.ViewDebug.RecyclerTraceType, int[]) should first check that this value is set to true as not to affect performance.
Constant Value: false

Public Constructors

public ViewDebug()

Public Methods

public static void startHierarchyTracing(String prefix, View view)

Starts tracing the view hierarchy of the specified view. The trace is identified by a prefix, used to build the traces files names: /tmp/view-hierarchy/PREFIX.traces and /tmp/view-hierarchy/PREFIX.tree. Only one view hierarchy can be traced at the same time. After calling this method, any other invocation will result in a IllegalStateException unless stopHierarchyTracing() is invoked before. Calling this method creates the file /tmp/view-hierarchy/PREFIX.traces containing all the traces (or method calls) relative to the specified view's hierarchy. This method will return immediately if TRACE_HIERARCHY is false.

Parameters

prefix the traces files name prefix
view the view whose hierarchy must be traced

public static void startRecyclerTracing(String prefix, View view)

Starts tracing the view recycler of the specified view. The trace is identified by a prefix, used to build the traces files names: /tmp/view-recycler/PREFIX.traces and /tmp/view-recycler/PREFIX.recycler. Only one view recycler can be traced at the same time. After calling this method, any other invocation will result in a IllegalStateException unless stopRecyclerTracing() is invoked before. Traces files are created only after stopRecyclerTracing() is invoked. This method will return immediately if TRACE_RECYCLER is false.

Parameters

prefix the traces files name prefix
view the view whose recycler must be traced

public static void stopHierarchyTracing()

Stops the current view hierarchy tracing. This method closes the file /tmp/view-hierarchy/PREFIX.traces. Calling this method creates the file /tmp/view-hierarchy/PREFIX.tree containing the view hierarchy of the view supplied to startHierarchyTracing(String, View). This method will return immediately if TRACE_HIERARCHY is false.

public static void stopRecyclerTracing()

Stops the current view recycer tracing. Calling this method creates the file /tmp/view-recycler/PREFIX.traces containing all the traces (or method calls) relative to the specified view's recycler. Calling this method creates the file /tmp/view-recycler/PREFIX.recycler containing all of the views used by the recycler of the view supplied to startRecyclerTracing(String, View). This method will return immediately if TRACE_RECYCLER is false.

public static void trace(View view, ViewDebug.RecyclerTraceType type, int[] parameters)

Outputs a trace to the currently opened recycler traces. The trace records the type of recycler action performed on the supplied view as well as a number of parameters.

Parameters

view the view to trace
type the type of the trace
parameters parameters depending on the type of the trace

public static void trace(View view, ViewDebug.HierarchyTraceType type)

Outputs a trace to the currently opened traces file. The trace contains the class name and instance's hashcode of the specified view as well as the supplied trace type.

Parameters

view the view to trace
type the type of the trace
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56