Android 跳转到指定应用市场,并进入应用详情页

1、跳转到制定应用市场

Uri uri =Url.parase("market://details?id=" +url);

Intent localIntent = newIntent("android.intent.action.VIEW",uri);

intent.setPackage(packageName);  //指定应用市场

intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

startActivity(intent);

 

 

2、打开系统文件夹并返回路径

 

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);

intent.setType("*/*");

intnet.addCategory(Intent.CATEGORY_OPENABLE);

startActivityForResult(intent,1);

 

protected void onActivityResult(intrequestCode,int resultCode,Intent data){

         if(resultCode==Activity.Result_OK){

                   Urirui=data.getData();

                   Filefile=new File(new URI(uri.toString()));

}

}

 

3、打开相册并返回

 

Intent intent =new Intent

(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTETN_URI);

startActivityForResult(intent,1);

 

 

方法2:

Intent intetn=newIntent(Intent.ACTION_MAIN);

intent.addCategory(Intent.CATEGORY_APP_GALLERY);

startActivityForResult(intetn,1);

你可能感兴趣的:(Android 跳转到指定应用市场,并进入应用详情页)