On your buttons, you should set OnClickListener, and to do some required actions you could see the example below:
设置OnClickListener监听事件:
To Open a Map with Certain Location // 打开特定地点的地图,使用以下代码:
mapButton.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + your-location-geo-address));
startActivity(i);
}
});
To call certain number // 呼叫某个号码:
callButton.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent i = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + telephone-number));
startActivity(i);
}
});
To open a website // 打开web站点:
linkButton.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(website-address));
startActivity(i);
}
});
Change "location-address", "telephone-number", and "website-address" with your own String value. I hope this helps.
//使用你的字符串修改变量"location-address", "telephone-number", and "website-address"