简体   繁体   中英

How to open particular image in gallery in android

I am using the following code to open android gallery when an image is clicked in my app

  Intent intent = new Intent (Intent.AUri.parse(  "content://media/internal/images/media" ));
  intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
  mActivity.startActivity(intent);

how can i modify my code to open a particular image directory or a particular image

According to me you should try this. In your MainActivity introduce a method to create intend for that and use syntax

 intent.setComponent(new ComponentName("com.example.administrator.YOUR GALLERY APP NAME","com.example.administrator.YOUR APP.MainActivity"));

where com.example.administration is the initial name of your package

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM