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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:08:14+00:00 2026-05-25T17:08:14+00:00

Every example I find for any code makes use of onCreate(). For many of

  • 0

Every example I find for any code makes use of onCreate(). For many of the classes I am writing for a program, I had to pass in the initial Activity as the classes required access to what is currently on display (EditText, Button, etc). I had attempted to make each class extend Activity but this typically resulted in run-time exceptions and failures. Currently, each class that requires input from the related View must make use of “parentactivity”.findViewByID(…).getData().

Is this the proper way to request data from a View? Should I create respective View objects (EditText, Button, etc) and attach those to the loaded views, then request data from there?

On what I perceive to be a related issue, I had attempted to create a RelativeRadioGroup of ToggleButtons (ToggleButtons in a RelativeLayout in a RadioGroup), only to find that the android:onClick attribute for them is not calling the available method. I have the method in the primary startup class (as well as a few other classes so as to pass the data to where it is needed). While I determined it is unlikely to call the method where the data is required (where the method was originally ONLY located), I do not understand why it is not called in the main class.

  • 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-25T17:08:15+00:00Added an answer on May 25, 2026 at 5:08 pm

    With regards to the radiobutton, did you add the listener?

    As for passing data from views I’ve taken two approaches. If I have used a stock View in the Activity I get the data and then pass only the data to where I need it. Or if its a Custom View I’ve added my own getData() like method to conveniently get the data in the format I need it.

    Don’t pass your Activity around just so you can access its View’s data.

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

Sidebar

Related Questions

Every example I can find is in C++, but I'm trying to keep my
Just about every piece of example code everywhere omits error handling (because it confuses
For invoke search android example, every time query search result is received by onCreate().
I find that I write a lot of code within my classes to keep
Use case example: Client A comes to request sales information, enters their zip code
Every example I've seen of CGI/Perl basically a bunch of print statements containing HTML,
Every example I've seen on the web, e.g. http://www.codeproject.com/KB/docview/jms_to_jms_bridge_activem.aspx , creates a publisher and
Every example I see seems to be for recursively getting files in subdirectories uses
Provide an example for the pseudo-regex: Match every url except those from example.com and
In the following example should I expect that values.size() will be called every time

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.