암시적 인텐트

[code java]
public void mOnClick(View v) {
Intent intent;
switch (v.getId()) {
case R.id.btnWeb:
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(“http://www.yell.co.kr”));
startActivity(intent);
break;

case R.id.btnCall:
intent = new Intent(Intent.ACTION_DIAL, Uri.parse(“tel:010-1234-5678”));
startActivity(intent);
break;

case R.id.btnPhoto:
intent = new Intent(Intent.ACTION_VIEW);
String sd = Environment.getExternalStorageDirectory().getAbsolutePath();
Uri uri = Uri.fromFile(new File(sd + “/devil.jpg”));
intent.setDataAndType(uri, “image/jpeg”);
startActivity(intent);
break;

default:
break;
}
}
[/code]

답글 남기기