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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:24:28+00:00 2026-05-28T07:24:28+00:00

This is a small prototype, but it repeats the error of the real program.

  • 0

This is a small prototype, but it repeats the error of the real program.

file TestLPActivity:

package cz.gangnus.testlp;
import android.app.Activity;
import android.os.Bundle;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;

public class TestLPActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        LinearLayout allForm = (LinearLayout) findViewById(R.id.AllChannelsListForm);
        int formWidth=1080;
        int formHeight=540;
        allForm.setLayoutParams(new LayoutParams(formWidth,formHeight));
    }
}

main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/AllChannelsListForm"
    android:layout_width="1080dp"
    android:layout_height="wrap_content"
    android:background="@drawable/channels_list_bg"
    android:gravity="top|left"
    android:orientation="vertical" >
</LinearLayout>

default manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cz.gangnus.testlp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".TestLPActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
</manifest>

The png file has 1140 width and 570 height

Without setting layoutparams everything is OK. But with it application falls after finishing onResume with the following stack:

FrameLayout(ViewGroup).measureChildWithMargins(View, int, int, int, int) line: 3129 
FrameLayout.onMeasure(int, int) line: 250   
FrameLayout(View).measure(int, int) line: 8313  
LinearLayout.measureVertical(int, int) line: 531    
LinearLayout.onMeasure(int, int) line: 309  
LinearLayout(View).measure(int, int) line: 8313 
PhoneWindow$DecorView(ViewGroup).measureChildWithMargins(View, int, int, int, int)     line: 3138   
PhoneWindow$DecorView(FrameLayout).onMeasure(int, int) line: 250    
PhoneWindow$DecorView(View).measure(int, int) line: 8313    
ViewRoot.performTraversals() line: 839  
ViewRoot.handleMessage(Message) line: 1859  
ViewRoot(Handler).dispatchMessage(Message) line: 99 
Looper.loop() line: 130 
ActivityThread.main(String[]) line: 3683    
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not    available [native method]   
Method.invoke(Object, Object...) line: 507  
ZygoteInit$MethodAndArgsCaller.run() line: 839  
ZygoteInit.main(String[]) line: 597 
NativeStart.main(String[]) line: not available [native method]  

Moving the param setting to onResume doesn’t change anything in behaviour.

Beforehand grateful for any help.

  • 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-28T07:24:29+00:00Added an answer on May 28, 2026 at 7:24 am

    try this way

    LayoutParams params = allForm.getLayoutParams();
    params.width=1080;
    params.height=540;
    allForm.setLayoutParams(params);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running this small C# test program launched from a pre-commit batch file private
We use this small utility method. But we don't like it. Since it's not
How do I convert this small script to Prototype: Basically I need to check
I've got this small question - given a bitmask of weekdays (e.g., Sunday =
I have this small code library that I'm considering releasing into Open Source. I
I have this small SQL query. SELECT a.`id` , a.`title` , a.`date` , (
I have this small class called City that simply holds some information about a
I'm building this small java applet in which I need a JPanel which will
I've found this small code that sends email to gmail users. I'd like the
Work on this small test application to learn threading/locking. I have the following code,

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.