title: Android: CustomListView with CustomAdapter, Call Button is not working
body: <p>In my app I have 3 views</p>
  
  <ul>
  <li>ImagiveView </li>
  <li>TextView</li>
  <li>Button</li>
  </ul>
  
  <p>ImagView displays image accordingly, TextView and Button display names and number accordingly. But the problem is when I click on the button it does not call to the number which is displaying on the button. Although it does open the android caller app.</p>
  
  <p>Telephone numbers are in string.xml file.</p>
  
  <p>Here I provide my all files. Please help me</p>
  
  <p>strings.xml</p>
  
  <pre><code>&lt;string-array name="names"&gt;
      &lt;item&gt;Abdul Malik&lt;/item&gt;
      &lt;item&gt;Adeel ur Rehman&lt;/item&gt;
      &lt;item&gt;Asad Majeeb&lt;/item&gt;
      &lt;item&gt;Ata ul Salam&lt;/item&gt;
      &lt;item&gt;Atta ul Qadir&lt;/item&gt;
      &lt;item&gt;Bilal Scunder&lt;/item&gt;
      &lt;item&gt;Chaudry Adnan Ahmed&lt;/item&gt;
      &lt;item&gt;Chaudry Imran&lt;/item&gt;
      &lt;item&gt;Ejaz Ahmed Saroya&lt;/item&gt;
      &lt;item&gt;Hamid Joya&lt;/item&gt;
  
  &lt;/string-array&gt;
  
  &lt;string-array name="telephones"&gt;
          &lt;item&gt;0000000000&lt;/item&gt;
          &lt;item&gt;0486607636&lt;/item&gt;
          &lt;item&gt;0485256515&lt;/item&gt;
          &lt;item&gt;0485128196&lt;/item&gt;
          &lt;item&gt;0465922084&lt;/item&gt;
          &lt;item&gt;0487150005&lt;/item&gt;
          &lt;item&gt;0488627993&lt;/item&gt;
          &lt;item&gt;0484783792&lt;/item&gt;
          &lt;item&gt;0484688663&lt;/item&gt;
          &lt;item&gt;0497697050&lt;/item&gt;
      &lt;/string-array&gt;
  </code></pre>
  
  <p>MainActivity.xml</p>
  
  <pre><code>package com.example.android.listview_with_custom_layout;
  
  import android.os.Bundle;
  import android.support.v7.app.ActionBarActivity;
  import android.widget.ListView;
  
  
  public class MainActivity extends ActionBarActivity {
  
      ListView listView;
      int [] movie_poster_resource={
              R.drawable.movie_1,
              R.drawable.movie_2,
              R.drawable.movie_3,
              R.drawable.movie_4,
              R.drawable.movie_5,
              R.drawable.movie_6,
              R.drawable.movie_7,
              R.drawable.movie_8,
              R.drawable.movie_9,
              R.drawable.movie_10,
  
      };
  
      String [] names ={};
      String [] telephones ={};
  
      MoviesAdapter moviesAdapter;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          listView=(ListView) findViewById(R.id.list_view);
          telephones =getResources().getStringArray(R.array.telephones);
          names =getResources().getStringArray(R.array.names);
          int i=0;
  
          moviesAdapter= new MoviesAdapter(getApplicationContext(),R.layout.row_layout);
          listView.setAdapter(moviesAdapter);
  
          for(String titles: names){
              MovieDataProvider movieDataProvider= new MovieDataProvider(movie_poster_resource[i], titles, telephones[i]);
  
              moviesAdapter.add(movieDataProvider);
              i++;
          }
      }
  }
  </code></pre>
  
  <p>MoviesDataAdapter</p>
  
  <pre><code>package com.example.android.listview_with_custom_layout;
  
  /**
   * Created by temp on 2/11/2015.
   */
  public class MovieDataProvider {
      private int movie_poster_resource;
      private String movie_title;
      private String telePhone;
  
      public MovieDataProvider(int movie_poster_resource, String movie_title, String telePhone) {
          this.setMovie_poster_resource(movie_poster_resource);
          this.setMovie_title(movie_title);
          this.telePhone = telePhone;
      }
  
      public int getMovie_poster_resource() {
          return movie_poster_resource;
      }
  
      public String getMovie_title() {
          return movie_title;
      }
  
      public String getTelePhone() {
          return telePhone;
      }
  
      public void setMovie_poster_resource(int movie_poster_resource) {
          this.movie_poster_resource = movie_poster_resource;
      }
  
      public void setMovie_title(String movie_title) {
          this.movie_title = movie_title;
      }
  
      public void setTelePhone(String telePhone) {
          this.telePhone = telePhone;
      }
  }
  </code></pre>
  
  <p>MoviesAdapter</p>
  
  <pre><code>package com.example.android.listview_with_custom_layout;
  
  import android.content.Context;
  import android.content.Intent;
  import android.net.Uri;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * Created by temp on 2/11/2015.
   */
  public class MoviesAdapter extends ArrayAdapter {
  
      List list = new ArrayList();
  
      MovieDataProvider dataProvider;
  
  
  
      public MoviesAdapter(Context context, int resource) {
          super(context, resource);
  
      }
  
      static class DataHandler {
          ImageView Poster;
          TextView title;
          Button telePhone;
      }
  
      @Override
      public void add(Object object) {
          super.add(object);
          list.add(object);
      }
  
      @Override
      public int getCount() {
          return this.list.size();
      }
  
      @Override
      public Object getItem(int position) {
          return this.list.get(position);
      }
  
      @Override
      public View getView(int position, View convertView, final ViewGroup parent) {
          View row;
          row = convertView;
  
  
          DataHandler handler;
          if (convertView == null) {
  
              LayoutInflater inflater = (LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              row = inflater.inflate(R.layout.row_layout, parent, false);
              handler = new DataHandler();
              handler.Poster = (ImageView) row.findViewById(R.id.movie_poster);
              handler.title = (TextView) row.findViewById(R.id.movie_title);
              handler.telePhone = (Button) row.findViewById(R.id.btn_call);
  
              row.setTag(handler);
  
          } else {
              handler = (DataHandler) row.getTag();
          }
  
  
          dataProvider = (MovieDataProvider) this.getItem(position);
          handler.Poster.setImageResource(dataProvider.getMovie_poster_resource());
          handler.title.setText(dataProvider.getMovie_title());
          handler.telePhone.setText(dataProvider.getTelePhone());
          handler.telePhone.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  // Intent to launch phone dialer
  
  
                  Intent intent = new Intent(Intent.ACTION_DIAL);
                  intent.setData(Uri.parse("tel:" + dataProvider.getTelePhone()));
                  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                  getContext().startActivity(intent);
              }
          });
  
          return row;
      }
  }
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#ffffd953"
      tools:context=".MainActivity"&gt;
  
      &lt;ListView
          android:id="@+id/list_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
      &lt;/ListView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>row_layout.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="80dp"
      android:background="#000000"
      android:orientation="vertical"
      android:paddingTop="10dp"&gt;
  
      &lt;ImageView
          android:id="@+id/movie_poster"
          android:layout_width="100dp"
          android:layout_height="75dp"
          android:layout_alignParentLeft="true"
          android:src="@drawable/movie_1" /&gt;
  
      &lt;TextView
          android:id="@+id/movie_title"
          android:layout_width="100dp"
          android:layout_height="75dp"
          android:layout_toRightOf="@+id/movie_poster"
          android:gravity="center"
          android:text="This is movie name"
          android:textColor="#FFFFFF" /&gt;
  
  
      &lt;Button
          android:id="@+id/btn_call"
          android:layout_width="wrap_content"
          android:layout_height="75dp"
          android:layout_alignParentRight="true"
          android:layout_toRightOf="@+id/movie_title"
          android:gravity="center"
          android:text="call"
          android:textColor="#FFFF" /&gt;
  
      &lt;View
          android:layout_width="match_parent"
          android:layout_height="2dp"
          android:layout_below="@+id/movie_poster"
          android:background="#FFFF"&gt;&lt;/View&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>