안드로이드 개발 질문/답변
(글 수 45,052)
protected boolean onTap(final int index) {
OverlayItem item = mOverlays.get(index);
AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);
dialog.setTitle(item.getTitle());
dialog.setMessage(item.getSnippet());
dialog.setPositiveButton("전화걸기", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{
Uri phone = Uri.parse("01026163174");
Intent intent1 = new Intent(Intent.ACTION_CALL, phone);
activity.startActivity(intent1);
}
});
여기까지 구현해서 전화걸기를 넣고 싶은데요 ItemizedOverlay
상속 받아서 해서 startActivity를 안먹어서 Activity activity = new Activity();
끌어와서 강제로 돌려 버렸는데 오류가 나네요 ㅠㅠ 도대체 onTap에서 activity 를 수월하게 돌리는 방법은 없을까요 ㅠㅠ
이겄댐에 미치겠네여 ㅠㅠ 도와주세요 고수님들
2010.10.31 11:36:38
네 퍼미션은 이미 주었고요..
Uri phone = Uri.parse("tel:42313112");
이쪽이 문제가 아닌듯 합니다.
그렇게도 해보았습니다. ㅠㅠ 자꾸 널 포인트가 뜨더라구요
activity.startActivity(intent1); 이곳에서요 원래 startActivity(intent1); 이렇게 썻었는데 startActivity 를 사용할수 없더라고요..
왜냐하면 오버레이 를 상속시켜서..ㅠㅠ 원래 Activity 를 상속해야하는데 ㅠㅠ 그래서 강제로 끌어온거라..
모 좋은수가 없을까요?ㅠㅠ
Uri phone = Uri.parse("tel:42313112");
이쪽이 문제가 아닌듯 합니다.
그렇게도 해보았습니다. ㅠㅠ 자꾸 널 포인트가 뜨더라구요
activity.startActivity(intent1); 이곳에서요 원래 startActivity(intent1); 이렇게 썻었는데 startActivity 를 사용할수 없더라고요..
왜냐하면 오버레이 를 상속시켜서..ㅠㅠ 원래 Activity 를 상속해야하는데 ㅠㅠ 그래서 강제로 끌어온거라..
모 좋은수가 없을까요?ㅠㅠ




퍼미션은 주셨나요?
<uses-permission android:name="android.permission.CALL_PHONE" />
아니면
Uri phone = Uri.parse("tel:42313112");
이렇게 바꿔보세요.