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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:06:29+00:00 2026-05-18T04:06:29+00:00

i have id @+id/call in single_item.xml when i use findVewById it (the layout setcontextview(R.layout.main))

  • 0

i have id “@+id/call” in single_item.xml when i use findVewById it (the layout setcontextview(R.layout.main)) .the app crash .how to fix the error
code single_items.xml used to inflate listView in class CustomSqlCursorAdapter

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
    android:src="@drawable/icon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:visibility="invisible"
/>
<LinearLayout
    android:orientation="vertical"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
     android:minWidth="30px"
    >
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:minWidth="30px"
        >
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Name: "
            android:id="@+id/name"
            android:textColor="#2E6100"
            android:textStyle="bold"
        />
        <TextView android:id="@+id/contact_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#2E6100"
             android:textStyle="bold"/>
    </LinearLayout>
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:minWidth="30px">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Phone: "
            android:clickable="true"
            android:id="@+id/phone"
            android:textColor="#2E6100"/>
        <TextView android:id="@+id/phone_number"
            android:layout_width="wrap_content"
           android:layout_height="wrap_content"
            android:textColor="#2E6100"/>
    </LinearLayout>
</LinearLayout>
<ImageView
    android:src="@drawable/icon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/call"
    android:clickable="true"
/> 
</LinearLayout>

class managecontact.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    mDbHelper = new database(this);
    mDbHelper.open();


    /* ImageView call=(ImageView)this.findViewById(R.id.call);
     call.setOnClickListener(new OnClickListener() {


        @Override
        public void onClick(View v) {
            //TODO Auto-generated method stub
            call();
        }                
     });*/



    registerForContextMenu(getListView());
}


private void fillData() {

    Cursor currentCursor = mDbHelper.fetchAllNotes();
    startManagingCursor(currentCursor);

    // Create an array to specify the fields we want to display in the list (only TITLE)
    String[] from = new String[]{database.KEY_TITLE};

    // and an array of the fields we want to bind those fields to (in this case just text1)
    int[] to = new int[]{ R.id.contact_name};

    // Now create a simple cursor adapter and set it to display
    CustomSqlCursorAdapter adapter = new CustomSqlCursorAdapter(this, R.layout.single_item,currentCursor, from, to);
    setListAdapter(adapter);

}
private void call() {

    Intent callIntent = new Intent(Intent.ACTION_CALL);
    callIntent.setData(Uri.parse("tel:123456789"));
    startActivity(callIntent);

}

i want to make a call when click the image icon .please show me how to correct this

  • 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-18T04:06:30+00:00Added an answer on May 18, 2026 at 4:06 am
    • You might have used inflater in your custom ListAdapter
    • In that, not exactly this but something similar, might have been done.
    • `if()
      {
      LinearLayout ll = yourInflater.inflate(….); else { ll= (LinearLayout) convertView;}
    • In order to get call id do like this:
      `ImageView call = ll.findViewById(r.id.call);

    Hope it will help you………..

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

Sidebar

Related Questions

i have id @+id/call in single_item.xml when i use findVewById it (the layout setcontextview(R.layout.main)
I have a ASP.NET MVC page, which call WCF logic. The system is single-signon
I have a call like this: $(#ContextMenuModal).height($(body).height()); However $(body).height() returns undefined when I view
I have a call to powershell.exe that looks like this, and which works from
I have to call stored procs in C# (.Net 2.0) sometimes using an ODBC
I have to call more than one webservice in one method each webservice is
I have to call a stored procedure and get the results. I know there
I have a call to a third-party C++ library which I have put into
I have to call an existing AMF Method in a PHP (or Perl) Script
I have to call phone number and detect if the modem at the opposite

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.