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 8595271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:23:44+00:00 2026-06-12T00:23:44+00:00

I am loading a webview with a close button and a slide button. When

  • 0

I am loading a webview with a close button and a slide button. When I clic

main.xml

<RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:background="#FFFFFF" 
    android:layout_marginRight="25dip"
    android:layout_marginTop="25dip"
    android:layout_marginLeft="25dip"
    android:layout_marginBottom="25dip" >
<WebView
    android:id="@+id/webac_larger"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
</WebView>

<ImageView android:id="@+id/close_btn"         
    android:layout_alignParentTop="true"         
    android:layout_alignParentRight="true"         
    android:layout_width="wrap_content"         
    android:layout_height="wrap_content"
    android:src="@drawable/close_button"
    android:layout_marginTop="-3dip"
    android:layout_marginRight="0dip"
    />  

<ImageButton 
    android:id="@+id/slidebutton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    android:layout_toLeftOf="@+id/close_btn"
    android:src="@drawable/arrowleft" />     

I want to resize webview on click of a button.

final ImageButton button1 = (ImageButton) findViewById(R.id.slidebutton);
        button1.setOnClickListener(new OnClickListener() {
          public void onClick(View v) {
            Log.d("MultiWeb", "I have clicked the button");
            RelativeLayout params = ((RelativeLayout )button1.getParent());
             params.setLayoutParams(new RelativeLayout.LayoutParams(100, 100));
          }
        });

I am getting this error. I am using relatice layout and why error says something about frame layout ?

java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams
  • 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-06-12T00:23:45+00:00Added an answer on June 12, 2026 at 12:23 am

    As stated in the Android Layouts API Guide, each type of ViewGroup has its own LayoutParams class that define the size and position for child Views.

    Instead of creating a brand new instance of one of the LayoutParams classes and risking a ClassCastException, you can call getLayoutParams() on your view to get the current parameter object, modify it as you wish, and call setLayoutParams() to apply the updated parameters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am loading a WebView in an Android application with the below code: mWebView.loadURL(https://wat.harminson.com/html/index.html);
I'm loading .swf files into a WebView directly using webView.loadUrl(http://whatever.com/file.swf); . It works perfectly
I am getting this error in webview while loading this url : http://www.thumbzine.com/rssfeed.php?vol=104 Error
I want to disable the left bar button when my webview is loading can
webview in android loads more than once while loading the url. Below is the
I just found that when the WebView is loading www.abc.com, and webViewDidStartLoad were hit
In my hybrid Android application, on a ListView item click I'm loading a WebView
I am loading url in android webview using below code webviewShowPost.loadUrl(URL); I want to
If I'm loading a WebView with an HTML document directly (no web server) using
I've put a WebView loading an image inside a ViewPager. When I try to

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.