多数の画像ビューがあるアプリに取り組んでいます。画像をクリックすると、Androidのデフォルトのギャラリー画像ピッカーを介して画像を開きます。私はこのように試しました:
String str = "android.resource://" + getPackageName() +"/"+R.drawable.wall1;
Uri path = Uri.parse(str);
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(path, "image/*");
startActivity(intent);
しかし、それは機能せず、例外が発生します:android.content.ActivityNotFoundException:インテントを処理するアクティビティが見つかりません{act = android.intent.action.VIEW dat = android.resource://com.example.demo/2130837505 typ =画像/* }