How to change the selected color (default green) of a toggle button

by Marco Nelissen » Mon, 09 Mar 2009 00:36:14 GMT


Sponsored Links
 You're talking about a CheckBox, which is derived from CompoundButton,
which is a button with two states. If you want to change how it looks,
you can specify your own Drawable for it, and either change it
yourself when the button changes state, or let the system do it for
you by specifying a drawable that has two states.





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Strange network behavior with two phones

Hi, I have two phones (Motorola Milestone) and I has developed a
simple application that does some network operations using web
services, the applications runs perfectly calling a method on the
emulator and in the phones, but just in one of the phones, in the
other one i always get a "operation timeout exception".

I have checked the network configuration in the 2 phones and is
identical, and the two phones has the same operator with unlimited
network plan, Im little lost here, and I dont know what else to check
or try.

If anyone has an idea or a possible explanation to this behavior, I
will appreciate your help.

-- 

2. Evaluate javascript value on WebView, Android

hi, I open a webview page that page have

    var addToBasketDisabled=false; var iPhoneStatus=""; function
GetStatus() { return iPhoneStatus;//Master Pagelerde tanml } var
path = "http://www.yemeksepeti.com/App_Themes/Default_tr-TR/images/
IPhone/"; function PreLoadDisabledButton() { var image = new Image();
image.src=path + "Iphone-button-ekle-pasif.png"; } function
DisableAddButton() { addToBasketDisabled= true; var buttonObject =
document.getElementById("ctl00_AddToBasket"); buttonObject.src = path
+ "Iphone-button-ekle-pasif.png"; } function EnableAddButton()
{ addToBasketDisabled= false; var buttonObject =
document.getElementById("ctl00_AddToBasket"); buttonObject.src = path
+ "Iphone-button-ekle.png"; } function OnAddButtonClick()
{ if(addToBasketDisabled) { return false; } DisableAddButton(); var
validateValue= ValidateInput(); if(!validateValue)
{ EnableAddButton(); return false; } } PreLoadDisabledButton();

these javascript When I press a button on the webview I have to read
the "iPhoneStatus" value and close the webview screen and decide the
result.

I wrote these codes in my .java class

 mWebView = (WebView) findViewById(R.id.webview);

    WebSettings webSettings = mWebView.getSettings();
    webSettings.setSavePassword(false);
    webSettings.setSaveFormData(false);
    webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
    webSettings.setJavaScriptEnabled(true);
    webSettings.setSupportZoom(false);

    mWebView.setWebChromeClient(new MyWebChromeClient());

    mWebView.addJavascriptInterface(new DemoJavaScriptInterface(),
"demo");

    mWebView.loadUrl(feedurl);
    final class DemoJavaScriptInterface
 {

  DemoJavaScriptInterface()
  {
  }

  public void clickOnAndroid()
  {
   mHandler.post(new Runnable()
   {
    public void run()
    {
     mWebView.loadUrl("javascript: GetStatus()");
    }
   });

  }
 }

 final class MyWebChromeClient extends WebChromeClient
 {
  public void onCloseWindow(WebView window)
  {
   window.destroy();
  }
  public boolean onJsAlert(WebView view, String url, String message,
JsResult result)
  {
   Log.i("log ", message);
   result.confirm();
   return true;
  }
 }

But it never go in the onJsAlert method, is there any way to evaluate
the value of GetStatus()

Thanks

-- 

3. How are credentials stored in the OS framework?

4. ExtandableLists and LongClicks

5. Getting ready to Publish

6. How to update Android firmware 2.1 to 2.2

7. EXTRA_OUTPUT file path being ignore capturing Video woes