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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:31:21+00:00 2026-06-11T19:31:21+00:00

Is there a quicker or shorter way to initialize all view in my layout

  • 0

Is there a quicker or shorter way to initialize all view in my layout than this:

    row2[0] = (RelativeLayout) findViewById(R.id.ll22);
    row2A[0] = (RelativeLayout) findViewById(R.id.ll22alt);
    row2B[0] = (RelativeLayout) findViewById(R.id.ll22blank);
    mOffsiteDataBackup[0] = (TextView) findViewById(R.id.ll22_backup);
    mRam[0] = (TextView) findViewById(R.id.ll22_ram);
    mCpu[0] = (TextView) findViewById(R.id.ll22_cpu);
    mHdd[0] = (TextView) findViewById(R.id.ll22_hdd);
    mOs[0] = (TextView) findViewById(R.id.ll22_system);
    mStatusIcon[0] = (ImageView) findViewById(R.id.ll22_image);
   .
   .
   .

It is really annoying to write lot of lines only to find views. Until I find all of them and initialize some listeners, my onCreate has more than 400 lines, which is something I certainly don’t want.

Thanks for your tips !

  • 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-11T19:31:22+00:00Added an answer on June 11, 2026 at 7:31 pm

    Any way you do it it’s going to be around the same amount of typing, in some cases even more. 50> an extreme amount of views in an activity…

    The only way I can think of making this smaller is splitting them up into Fragments and use the updated framework… 70 elements shouldn’t be in one ui.. a ui is meant to be simple and easy to use. Not with lots of elements to it that distracts the user from the main task they want it for.

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

Sidebar

Related Questions

Is there a quicker way than the following to 'flip' a true or false
Is there a quicker (or better) way to get the [RGBA] color components from
Is there a quicker way of creating a date such as: echo date('Y-m-d', mktime(0,
Is there a better way to do this function? Even though i'm doing the
Is there a better way of doing this... MyString.Trim().Replace(&, and).Replace(,, ).Replace( , ) .Replace(
Is there a quicker, more efficient means of doing so than using a ListIterator
I'm wondering is there a quicker, more efficent way of comparing two text files
is there a quicker way to maven install say a complete lib folder to
Is there a quicker way to do the following? Want to cut down the
Is there anyway to get the alt tag to display quicker? Also, I notice

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.