[英]IMAGE TOUCH EVENT IN ANDROID CAMERA VIEW
我在相機視圖中顯示一個png圖像,我想在觸摸/單擊圖像並在事件處理程序中打開帶有某些url的瀏覽器時生成一個touch / click事件,我的代碼是
/** Called when the activity is first created. */
@Override
ImageView iv=(ImageView) findViewById(R.id.test_image);
iv.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.cdacb.in"));
startActivityForResult(browserIntent,0);
}
此意圖可能對您有幫助:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse("http://www.cdacb.in"));
startActivity(intent);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.