Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6021497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:43:16+00:00 2026-05-23T03:43:16+00:00

@Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); Main(); }

  • 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    Main();

}
public void Main()
{
    _linearLayout = new LinearLayout(this);
    _webview = new WebView(this);
    _linearLayout.addView(_webview, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
    setContentView(_linearLayout);

    _webview.getSettings().setJavaScriptEnabled(true);
    _webview.getSettings().setPluginsEnabled(true);
    _webview.getSettings().setAllowFileAccess(true);

    _webview.setWebChromeClient(new WebChromeClient());
    _webview.addJavascriptInterface(this, "Question");
    _webview.loadData(GetHTML(), "text/html", "utf-8");


}

public String GetHTML()
{   
    String HTML = ""
        + "<HTML>"
        + "<HEAD>"
        + "<TITLE>Radio Button onClick Handler</TITLE>"
        + "<SCRIPT LANGUAGE=\"JavaScript\">"
        +"function function1(colors) {" 
        +"var col = (colors.options[colors.selectedIndex].value);"
        +" if (col) {"
        +"  document.bgColor = col;"

        +"   } "
        +"</script>"
        + "</HEAD>"
        + "<BODY>"
        +"<form>"
        +"<b> Hello </b>"
        //+"<select name=\"colors\" onChange=\"window.Question.function1(this);\">"
        +"<select name=\"colors\" onChange=\"window.Question.OnJsClick_SelectedItem(' string value');\">"
           +"<option value=\"white\" selected>White</option>"
           + "<option value=\"cyan\">Cyan</option>"
           + "<option value=\"ivory\">Ivory</option>"
           + "<option id=\"myO\" value=\"blue\">Blue</option>"

        +"</select>"
        +"</form>"
        + "</BODY>"
        + "</HTML>";

    return HTML;
}

public void OnJsClick_SelectedItem(final String str)
{
    mHandler.post(new Runnable()
    {
        //@Override
        public void run()
        {
            getValue(str);
        }
    });
}

public String getValue(String str)
{
    _webview.loadUrl("javascript:function1(colors)");
    Toast.makeText(this, "Under getValue " + str, Toast.LENGTH_SHORT).show();
    return str;

}
}

Please help me out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:43:17+00:00Added an answer on May 23, 2026 at 3:43 am

    You should use something like this:

    <select name="colors"
        onChange="Question.OnJsClick_SelectedItem(this.options[this.selectedIndex].text)">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public class Browser1Activity extends Activity { TextView url; WebView ourBrow; @Override protected void onCreate(Bundle
i have the following method in a usercontrol protected override void Render(HtmlTextWriter writer) {
i found this code: protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); HwndSource hwndSource =
In my code behind I wire up my events like so: protected override void
package { import mx.controls.LinkButton; import flash.text.TextLineMetrics; public class multiLineLinkButton extends LinkButton { override protected
protected override Boolean IsValid(String propertyValue) { return !String.IsNullOrEmpty(propertyValue) && propertyValue.Trim().Length > 0; } This
protected override Size MeasureOverride(Size availableSize) { foreach (UIElement child in Children) { child.Measure(availableSize); //you
I have a code: protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { switch
In this code (from the WCF REST starterkit - preview2): protected override SampleItem OnAddItem(SampleItem
package com.comboyz.TantaGo; import android.app.ListActivity; import android.os.Bundle; import android.widget.ArrayAdapter; public class startMenu extends ListActivity{ @Override

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.