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

  • Home
  • SEARCH
  • 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 6011229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:13:48+00:00 2026-05-23T02:13:48+00:00

is it possible to set mWebView = (WebView) findViewById(R.id.webviewHelp); mWebView.setLayoutParams(new ViewGroup.LayoutParams(100, 200)); here mWebView.setLayoutParams(new

  • 0

is it possible to set

mWebView = (WebView) findViewById(R.id.webviewHelp);
        mWebView.setLayoutParams(new ViewGroup.LayoutParams(100, 200));

here

 mWebView.setLayoutParams(new Gallery.LayoutParams(70,85));

is also tested but not working 🙁

in my activity?
my xml file is as below

(here i’ve to create webview through XML is needed in my application)

 <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"   android:id="@+id/rl"
        android:layout_height="360dip">
    <!--    <WebView android:id="@+id/webviewHelp" android:layout_width="fill_parent"-->
    <!--        android:layout_height="fill_parent" />-->
    <WebView android:id="@+id/webviewHelp" android:layout_width="fill_parent"
            android:layout_height="fill_parent" />
        <Button android:id="@+id/My_btn"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true" android:gravity="center" android:textSize="8px" android:text="Download this mp3 file"
    android:textColor="@color/white" 
            android:layout_width="fill_parent" android:layout_height="33dip"
            android:visibility="invisible" />
        <Button android:id="@+id/My_btn1"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true" android:text="this is button !"
            android:layout_width="0dip" android:layout_height="0dip"
            android:visibility="invisible" />
    </RelativeLayout>

and i am getting this ERROR and application forcefully close

06-11 15:42:51.816: DEBUG/AndroidRuntime(323): Shutting down VM
06-11 15:42:51.816: WARN/dalvikvm(323): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)
06-11 15:42:51.816: ERROR/AndroidRuntime(323): Uncaught handler: thread main exiting due to uncaught exception
06-11 15:42:51.835: ERROR/AndroidRuntime(323): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.RelativeLayout$DependencyGraph.findRoots(RelativeLayout.java:1291)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.RelativeLayout$DependencyGraph.getSortedViews(RelativeLayout.java:1238)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.RelativeLayout.sortChildren(RelativeLayout.java:279)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:299)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.View.measure(View.java:7703)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.View.measure(View.java:7703)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.View.measure(View.java:7703)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.View.measure(View.java:7703)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:569)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:361)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.View.measure(View.java:7703)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.View.measure(View.java:7703)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.View.measure(View.java:7703)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.View.measure(View.java:7703)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.View.measure(View.java:7703)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.ViewRoot.performTraversals(ViewRoot.java:747)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.os.Looper.loop(Looper.java:123)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at android.app.ActivityThread.main(ActivityThread.java:4203)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at java.lang.reflect.Method.invokeNative(Native Method)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at java.lang.reflect.Method.invoke(Method.java:521)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
06-11 15:42:51.835: ERROR/AndroidRuntime(323):     at dalvik.system.NativeStart.main(Native Method)
06-11 15:42:51.845: INFO/Process(52): Sending signal. PID: 323 SIG: 3
06-11 15:42:51.845: INFO/dalvikvm(323): threadid=7: reacting to signal 3
06-11 15:42:51.857: ERROR/dalvikvm(323): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
06-11 15:42:52.566: DEBUG/dalvikvm(99): GC freed 4505 objects / 251696 bytes in 293ms

what is wrong i am doing? thanks in advance :Pragna

  • 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-23T02:13:48+00:00Added an answer on May 23, 2026 at 2:13 am

    Instead of this:

       mWebView = (WebView) findViewById(R.id.webviewHelp);    
       mWebView.setLayoutParams(new ViewGroup.LayoutParams(100, 200));
    

    use:

       mWebView = (WebView) findViewById(R.id.webviewHelp);        
       LayoutParamters lp = mWebView.getLayoutParams();    
       lp.width=100;   
       lp.height=200;   
       mWebView.setLayoutParams(lp); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Set HTML5 doctype with XSLT I'm new to xslt and I'm trying
In Java SE it is possible set the cause of an exception using initCause
Is possible to set an image as an iPhone application unique icon in code
Is it possible to set code behind a resource dictionary in WPF. For example
Is it possible to set the cursor to 'wait' on the entire html page
Is it possible to set the data in a ContentPlaceHolder through code? This is
Is it possible to set the position of the tabs to be at the
Is it possible to set up a Grid or other container control to be
Is it possible to set some image as title of Navigation bar? I think
Is it possible to set up somehow Microsoft SQL Server to run a stored

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.