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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:35:34+00:00 2026-05-26T23:35:34+00:00

in my app when the activity get loaded, i am doing the following setContentView(R.layout.main2);

  • 0

in my app when the activity get loaded, i am doing the following

setContentView(R.layout.main2);
layoutToAdd = (LinearLayout) findViewById(R.id.linearLayout1);

for(i=0; i<num;i++)
{
    LayoutInflater inflater = LayoutInflater.from(getApplicationContext());
    View view = inflater.inflate(R.layout.camera, null);
    layoutToAdd.addView(view);
}

The value of num differs for each time.

In my LayoutInflater layout i have a text view, edit text and a button.

Now they are shown according to the number of times mentioned in num, now for each time i want the text and button name to be changed. How to set the text for TextView and Button.

  • 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-26T23:35:34+00:00Added an answer on May 26, 2026 at 11:35 pm

    Just set them after you inflate the layout

    View view = inflater.inflate(R.layout.camera, null);
    TextView tv = view.findViewById(R.id.textviewid); //id defined in camera.xml
    Button b = view.findViewById(R.id.buttonid);      //id defined in camera.xml
    tv.setText();
    b.setText();
    layoutToAdd.addView(view);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to implement the following simple pattern in an android app: Activity
Here is my code import org.ksoap2.*; import org.ksoap2.serialization.*; import org.ksoap2.transport.*; import android.app.Activity; import android.os.Bundle;
I'm trying to monitor the gc activity in my app, using -verbosegc flag. I
In my App, first it shows a splash screen. After that another activity, then
I have a widget that supposed to call an Activity of the main app
An app I'm writing always crashes on a clients computer, but I don't get
My app uses a WebRequest at certain points to get pages from itself. This
I am attempting to get my app to open a settings menu screen and
I've modified my previous code for login. package log1.log2; import android.app.Activity; import android.content.Intent; import
aka, what is wrong with this code:- package com.mez.appofjaq; import com.mez.appofjaq.RssParser.RssFeed; import android.app.Activity; import

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.