У меня есть вид карты, который отображает элементарное наложение, и каждое событие onTap показывает диалог с информацией о туристическом агентстве и тремя кнопками, одна из которых должна открывать веб-сайт агентства в браузере, но когда я нажимаю кнопка, которую я получил: не найдено действий для обработки намерений.
вот мой код:
protected boolean onTap(int i){
float[] results = new float[1];
Location.distanceBetween(decdegrees(appState.getMyLocation().getLatitudeE6()), decdegrees(appState.getMyLocation().getLongitudeE6()), decdegrees(points.get(i).getPoint().getLatitudeE6()), decdegrees(points.get(i).getPoint().getLongitudeE6()), results);
float distance = results[0]/1000;
DecimalFormat maxDigitsFormatter = new DecimalFormat("#.#");
String infos=points.get(i).getSnippet() + "#" + String.valueOf(maxDigitsFormatter.format(distance));
final String [] AInfos = infos.split("#");
final Dialog ADialog = new Dialog(c);
ADialog.setContentView(R.layout.travelagency);
TextView txtAgence = (TextView)ADialog.findViewById(R.id.txtAgence);
TextView txtAddress = (TextView)ADialog.findViewById(R.id.txtAddress);
TextView txtDistance = (TextView)ADialog.findViewById(R.id.txtDistance);
TextView txtFax = (TextView)ADialog.findViewById(R.id.txtFax);
Button btnCall = (Button)ADialog.findViewById(R.id.btnCall);
Button btnWebSite = (Button)ADialog.findViewById(R.id.btnWebSite);
Button btnCancel = (Button)ADialog.findViewById(R.id.btnCancel);
ADialog.setTitle(AInfos[0]);
btnCall.setText("Appeler : " + AInfos[2]);
txtAgence.setText(AInfos[1]);
txtDistance.setText("Approximativement à : " +AInfos[6] + " Km");
txtAddress.setText("Adresse : " + AInfos[3]);
txtFax.setText("Fax : " + AInfos[4]);
ADialog.show();
btnCancel.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
ADialog.dismiss();
}
});
btnWebSite.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(AInfos[5]));
v.getContext().startActivity(myIntent);
}
});
return (true);
}
Я нашел примеры здесь и здесь , но, как ни странно, у меня не работает ..
спасибо