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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:09:39+00:00 2026-05-26T09:09:39+00:00

I have a list_view_row xml file. The list_view_row.xml contains editText boxes, i want to

  • 0

I have a list_view_row xml file.
The list_view_row.xml contains editText boxes, i want to use them to display the items (collected by a SimpleAdapter) in the listbox in my main program (Android.java).
Eclipse won`t let me compile the code as i need to declare these editText boxes in Android.java

 int[] to = new int[] { R.id.editText1, R.id.editText1 };

How do i do that?
Thank you in advance.

The list_view_row.xml:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal" 
  android:width="100dp" 
  android:height="100dp"
>

<EditText> 
 android:inputType="textMultiLine"  
 android:id="@+id/editText1"  
 android:layout_height="wrap_content"  
 android:text="edit1"  
 android:layout_width="110dp"> 
</EditText>  

<EditText> 
 android:layout_height="wrap_content"  
 android:layout_width="110dp"  
 android:id="@+id/editText2"  
 android:text="edit2" 
 android:inputType="textMultiLine" 
 android:layout_marginLeft="50dp" 
</EditText> 

</LinearLayout>

The code in main.xml:

@Override 
    protected void onPostExecute(String result) { 
        //publishProgress(false); 
        // create the grid item mapping
        ListView kp = (ListView)findViewById(R.id.kpn);

        String[] from = new String[] {"col_1", "col_2"};
        int[] to = new int[] { R.id.editText1, R.id.editText1 }; <<< ??????????

        List<HashMap<String, String>> fillMaps = new ArrayList<HashMap<String, String>>();
        HashMap<String, String> map = new HashMap<String, String>();

        Document doc = Jsoup.parse(kpn);
        Elements tdsFromSecondColumn = doc.select("table.personaltable td:eq(0)");
        Elements tdsFromSecondColumn1 = doc.select("table.personaltable td:eq(1)"); 

        for (Element tdFromSecondColumn : tdsFromSecondColumn) {
            map.put("col_1", tdFromSecondColumn.text()); 
            fillMaps.add(map);

            System.out.println("Hashmap: " + map);
            System.out.println(tdFromSecondColumn.text()); 

        } 
        for (Element tdFromSecondColumn1 : tdsFromSecondColumn1) {
            map.put("col_2", tdFromSecondColumn1.text());
            fillMaps.add(map);

            System.out.println("Hashmap: " + map);
            System.out.println(tdFromSecondColumn1.text());
        }

        SimpleAdapter adapter = new SimpleAdapter(AndroidLogin.this, fillMaps, R.layout.list_view_row, from, to); 
        kp.setAdapter(adapter);
  • 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-26T09:09:39+00:00Added an answer on May 26, 2026 at 9:09 am

    Your XML is incorrect, here is the correct format:

    <EditText android:inputType="textMultiLine"  
     android:id="@+id/editText1"  
     android:layout_height="wrap_content"  
     android:text="edit1"  
     android:layout_width="110dp"/>
    

    Once you correct this, build your project and the R.id.editText1 and R.id.editText2 should be recognized in code.

    EDIT: Hint – go to your Project menu at the top, and then down to “Build Automatically.” This will cause your project to build upon saving a file (java / xml). After you modify the XML, and save, it will build and make your editText1 resource available to access by R.id.editText1.

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

Sidebar

Related Questions

hi i have two xml file and i want to bind grid view eith
I have attached the contents of an xml file. What I want to do
I have an xml layout which I use for each row in my listview:
I have a listView, a main xml file and a customListview xml file. for
I want to use a list view and I have created my own layout
I have an xml with one textveiw and one edittext in it .I used
I have a bunch of resource images, and I want to display a certain
I have list view with custom row layout (list_row.xml) that contains CheckBox element: <TableLayout
I have a xml file for layout of each row of listview. I have
I have a xml file name list_row.xml, this was load in a listView: <?xml

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.