You've set you button not clickable.

On Apr 18, 2009 2:39 AM, "kevin" <kevin_x...@yahoo.com> wrote:


I programmed the layout instead of layout.xml (for our own reason).
Following is the code:

       LinearLayout mainPanel = new LinearLayout(ctx);
           mainPanel.setLayoutParams(new LinearLayout.LayoutParams
(LinearLayout.LayoutParams.FILL_PARENT,
                   LinearLayout.LayoutParams.FILL_PARENT));
           mainPanel.setOrientation(LinearLayout.VERTICAL);
           mainPanel.setEnabled(true);
           mainPanel.setClickable(true);

       Button button = new Button(ctx);
           button.setLayoutParams(new LinearLayout.LayoutParams
(LinearLayout.LayoutParams.WRAP_CONTENT,

LinearLayout.LayoutParams.WRAP_CONTENT));
           button.setText("  Done  ");
           button.setGravity(Gravity.CENTER);
           button.setOnClickListener(this);
           button.setPadding(3,3,6,3);
           button.setClickable(false);
           button.setEnabled(false);

       WebView mWebView = new WebView(ctx);
           mWebView.setLayoutParams(new LinearLayout.LayoutParams
(LinearLayout.LayoutParams.FILL_PARENT,

LinearLayout.LayoutParams.WRAP_CONTENT));
           WebSettings webSettings = mWebView.getSettings();
           webSettings.setJavaScriptEnabled(true);
           webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
               mWebView.setFocusable(true);
               mWebView.setFocusableInTouchMode(true);
           mWebView.setClickable(true);
           mWebView.setEnabled(true);
           mWebView.setLongClickable(true);
           mWebView.setOnClickListener(this);

       mainPanel.addView(button);
       mainPanel.addView(mWebView);

       setContentView(mainPanel);

--~--~---------~--~----~------------~-------~--~----~ You received this
message because you are sub...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to