Skip to content Skip to sidebar Skip to footer

Android List View Button Make A Call

i am trying to put a button on my listView item and make a call... but so far, I couldn't figure out how to assign that data to that button action and here is my code... The list i

Solution 1:

We don't know how you define the class 'info' so here's my guess:

first, change the line:

infolm= (info) getItem(position);

to

finalinfolm= (info) getItem(position);

then here's how to invoke ACTION_DIAL with phone number:

holder.call.setOnClickListener(newOnClickListener() {
    @OverridepublicvoidonClick(View arg0) {

    Intentcall=newIntent (Intent.ACTION_DIAL, Uri.parse("tel:" + lm.getPhone()));

        ///  No clue.. >,<  ///  /// lm.getPhone() should get the phone# for this row./// this action does not work   /////

    startActivity(call);
}

This is assuming the lm.getPhone() method returns a phone number in string.

Post a Comment for "Android List View Button Make A Call"