Tuesday, September 3, 2019

Link Ke Telepon

Link Ke Telepon


XML

<TextView
            android:id="@+id/ttelp"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="telepon"
            android:textColor="#000000"
            android:textSize="20sp"
            android:textStyle="bold"/>
       
        <!--  Name TextField -->
        <EditText
            android:background="#dddddd"
            android:id="@+id/txttelepon"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:textColor="#000000" />


JAVA

txttelepon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse(txttelepon.getText().toString())));
}});

txttelp= (TextView) findViewById(R.id.ttelp);
txttelp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse(txttelepon.getText().toString())));
}});

No comments:

Post a Comment

Mengganti Icon Marker Di Maps

                                            Creating an icon https://leafletjs.com/examples.html var greenIcon = ...