Loading core/java/com/android/internal/widget/SlidingTab.java +12 −2 Original line number Diff line number Diff line Loading @@ -548,12 +548,22 @@ public class SlidingTab extends ViewGroup { return true; } /** * Reset the tabs to their original state and stop any existing animation. * Animate them back into place if animate is true. * * @param animate */ public void reset(boolean animate) { mLeftSlider.reset(animate); mRightSlider.reset(animate); } @Override public void setVisibility(int visibility) { // Clear animations so sliders don't continue to animate when we show the widget again. if (visibility != getVisibility() && visibility == View.INVISIBLE) { mLeftSlider.reset(false); mRightSlider.reset(false); reset(false); } super.setVisibility(visibility); } Loading docs/html/guide/developing/debug-tasks.jd +30 −20 Original line number Diff line number Diff line Loading @@ -58,8 +58,8 @@ Log.i("MyActivity", "MyClass.getView() — get item number " + position); <pre class="no-pretty-print"> I/MyActivity( 1557): MyClass.getView() — get item number 1 </pre> <p>Logcat is also the place to look when debugging a web page in the Android browser. All browser bugs will be output to logcat with the {@code WebCore} tag. <p>Logcat is also the place to look when debugging a web page in the Android Browser app. See <a href="#DebuggingWebPages">Debugging Web Pages</a> below.</p> </dl> <p>For more information about all the development tools provided with the Android SDK, see the <a Loading Loading @@ -148,10 +148,10 @@ following options (among others):</p> <h2 id="DebuggingWebPages">Debugging Web Pages</h2> <p>If you're developing a web application for Android devices, you can debug your JavaScript on Android using the Console APIs, which will output messages to logcat. If you're familiar <p>If you're developing a web application for Android devices, you can debug your JavaScript in the Android Browser using the Console APIs, which will output messages to logcat. If you're familiar debugging web pages with Firefox's FireBug or WebKit's Web Inspector, then you're probably familiar with the Console APIs. The Android Browser (and {@link android.webkit.WebChromeClient}) supports with the Console APIs. The Android Browser (and the {@link android.webkit.WebChromeClient}) supports most of the same APIs.</p> <p>When you call a function from the Console APIs (in the DOM's {@code window.console} object), Loading @@ -162,19 +162,28 @@ console.log("Hello World"); </pre> <p>Then the logcat output from the Android Browser will look like this:</p> <pre class="no-pretty-print"> W/browser ( 202): Console: Hello World :0 W/browser ( 202): Console: Hello World http://www.example.com/hello.html :82 </pre> <p class="note"><strong>Note:</strong> All Console messages from the Android Browser are tagged with the name "browser" on Android platforms running API Level 7 or higher and tagged with the name "WebCore" for platforms running API Level 6 or lower.</p> <p>Not all of the Console APIs available in Firefox or other WebKit browsers are implemented on Android. Mostly, you need to depend on basic text logging provided by functions like {@code console.log(String)}, {@code console.info(String)}, {@code console.warn(String)}, and {@code console.error(String)}. Although other Console functions may not be implemented, they will not raise run-time errors, but will simply not behave as you might expect.</p> <p>All Console messages from the Android Browser are tagged with the name "browser" on Android platforms running API Level 7 or higher. On platforms running API Level 6 or lower, Browser messages are tagged with the name "WebCore". The Android Browser also formats console messages with the log message preceded by "Console:" and then followed by the address and line number where the message occurred. (The format for the address and line number will appear different from the example above on platforms running API Level 6 or lower.)</p> <p>The Android Browser (and {@link android.webkit.WebChromeClient}) does not implement all of the Console APIs provided by Firefox or other WebKit-based browsers. Primarily, you need to depend on the basic text logging functions:</p> <ul> <li>{@code console.log(String)}</li> <li>{@code console.info(String)}</li> <li>{@code console.warn(String)}</li> <li>{@code console.error(String)}</li> </ul> <p>Although the Android Browser may not fully implement other Console functions, they will not raise run-time errors, but may not behave the same as they do on other desktop browsers.</p> <p>If you've implemented a custom {@link android.webkit.WebView} in your application, then in order to receive messages that are sent through the Console APIs, you must provide a {@link Loading @@ -185,7 +194,7 @@ android.webkit.WebView} in your application, you can log debug messages like thi <pre> myWebView.setWebChromeClient(new WebChromeClient() { public void onConsoleMessage(String message, int lineNumber, String sourceID) { Log.d("MyApplication", message); Log.d("MyApplication", message + " -- From line " + lineNumber + " of " + sourceID); } }); </pre> Loading @@ -195,13 +204,14 @@ within your {@link android.webkit.WebView}.</p> <p>When the "Hello World" log is executed through your {@link android.webkit.WebView}, it will now look like this:</p> <pre class="no-pretty-print"> D/MyApplication ( 430): Hello World D/MyApplication ( 430): Hello World -- From line 82 of http://www.example.com/hello.html </pre> <p class="note"><strong>Note:</strong> The {@link android.webkit.WebChromeClient#onConsoleMessage(String,int,String) onConsoleMessage()} callback method was added with API Level 7. If you are targetting platforms running API Level 6 or lower, then your Console messages will automatically be sent to logcat with the "WebCore" logging tag.</p> method was added with API Level 7. If you are using a custom {@link android.webkit.WebView} on a platform running API Level 6 or lower, then your Console messages will automatically be sent to logcat with the "WebCore" logging tag.</p> Loading docs/html/resources/samples/images/SampleSyncAdapter1.png 0 → 100644 +31.6 KiB Loading image diff... docs/html/resources/samples/images/SampleSyncAdapter2.png 0 → 100644 +44.8 KiB Loading image diff... docs/html/resources/samples/images/SampleSyncAdapter3.png 0 → 100644 +37.1 KiB Loading image diff... Loading
core/java/com/android/internal/widget/SlidingTab.java +12 −2 Original line number Diff line number Diff line Loading @@ -548,12 +548,22 @@ public class SlidingTab extends ViewGroup { return true; } /** * Reset the tabs to their original state and stop any existing animation. * Animate them back into place if animate is true. * * @param animate */ public void reset(boolean animate) { mLeftSlider.reset(animate); mRightSlider.reset(animate); } @Override public void setVisibility(int visibility) { // Clear animations so sliders don't continue to animate when we show the widget again. if (visibility != getVisibility() && visibility == View.INVISIBLE) { mLeftSlider.reset(false); mRightSlider.reset(false); reset(false); } super.setVisibility(visibility); } Loading
docs/html/guide/developing/debug-tasks.jd +30 −20 Original line number Diff line number Diff line Loading @@ -58,8 +58,8 @@ Log.i("MyActivity", "MyClass.getView() — get item number " + position); <pre class="no-pretty-print"> I/MyActivity( 1557): MyClass.getView() — get item number 1 </pre> <p>Logcat is also the place to look when debugging a web page in the Android browser. All browser bugs will be output to logcat with the {@code WebCore} tag. <p>Logcat is also the place to look when debugging a web page in the Android Browser app. See <a href="#DebuggingWebPages">Debugging Web Pages</a> below.</p> </dl> <p>For more information about all the development tools provided with the Android SDK, see the <a Loading Loading @@ -148,10 +148,10 @@ following options (among others):</p> <h2 id="DebuggingWebPages">Debugging Web Pages</h2> <p>If you're developing a web application for Android devices, you can debug your JavaScript on Android using the Console APIs, which will output messages to logcat. If you're familiar <p>If you're developing a web application for Android devices, you can debug your JavaScript in the Android Browser using the Console APIs, which will output messages to logcat. If you're familiar debugging web pages with Firefox's FireBug or WebKit's Web Inspector, then you're probably familiar with the Console APIs. The Android Browser (and {@link android.webkit.WebChromeClient}) supports with the Console APIs. The Android Browser (and the {@link android.webkit.WebChromeClient}) supports most of the same APIs.</p> <p>When you call a function from the Console APIs (in the DOM's {@code window.console} object), Loading @@ -162,19 +162,28 @@ console.log("Hello World"); </pre> <p>Then the logcat output from the Android Browser will look like this:</p> <pre class="no-pretty-print"> W/browser ( 202): Console: Hello World :0 W/browser ( 202): Console: Hello World http://www.example.com/hello.html :82 </pre> <p class="note"><strong>Note:</strong> All Console messages from the Android Browser are tagged with the name "browser" on Android platforms running API Level 7 or higher and tagged with the name "WebCore" for platforms running API Level 6 or lower.</p> <p>Not all of the Console APIs available in Firefox or other WebKit browsers are implemented on Android. Mostly, you need to depend on basic text logging provided by functions like {@code console.log(String)}, {@code console.info(String)}, {@code console.warn(String)}, and {@code console.error(String)}. Although other Console functions may not be implemented, they will not raise run-time errors, but will simply not behave as you might expect.</p> <p>All Console messages from the Android Browser are tagged with the name "browser" on Android platforms running API Level 7 or higher. On platforms running API Level 6 or lower, Browser messages are tagged with the name "WebCore". The Android Browser also formats console messages with the log message preceded by "Console:" and then followed by the address and line number where the message occurred. (The format for the address and line number will appear different from the example above on platforms running API Level 6 or lower.)</p> <p>The Android Browser (and {@link android.webkit.WebChromeClient}) does not implement all of the Console APIs provided by Firefox or other WebKit-based browsers. Primarily, you need to depend on the basic text logging functions:</p> <ul> <li>{@code console.log(String)}</li> <li>{@code console.info(String)}</li> <li>{@code console.warn(String)}</li> <li>{@code console.error(String)}</li> </ul> <p>Although the Android Browser may not fully implement other Console functions, they will not raise run-time errors, but may not behave the same as they do on other desktop browsers.</p> <p>If you've implemented a custom {@link android.webkit.WebView} in your application, then in order to receive messages that are sent through the Console APIs, you must provide a {@link Loading @@ -185,7 +194,7 @@ android.webkit.WebView} in your application, you can log debug messages like thi <pre> myWebView.setWebChromeClient(new WebChromeClient() { public void onConsoleMessage(String message, int lineNumber, String sourceID) { Log.d("MyApplication", message); Log.d("MyApplication", message + " -- From line " + lineNumber + " of " + sourceID); } }); </pre> Loading @@ -195,13 +204,14 @@ within your {@link android.webkit.WebView}.</p> <p>When the "Hello World" log is executed through your {@link android.webkit.WebView}, it will now look like this:</p> <pre class="no-pretty-print"> D/MyApplication ( 430): Hello World D/MyApplication ( 430): Hello World -- From line 82 of http://www.example.com/hello.html </pre> <p class="note"><strong>Note:</strong> The {@link android.webkit.WebChromeClient#onConsoleMessage(String,int,String) onConsoleMessage()} callback method was added with API Level 7. If you are targetting platforms running API Level 6 or lower, then your Console messages will automatically be sent to logcat with the "WebCore" logging tag.</p> method was added with API Level 7. If you are using a custom {@link android.webkit.WebView} on a platform running API Level 6 or lower, then your Console messages will automatically be sent to logcat with the "WebCore" logging tag.</p> Loading