0
すべての方法を試しましたが、ビューページャから画像を取得できません。イメージの現在の位置も取得しました。しかし、私はフォルダから画像を取得することはできません。ビューページャで現在の画像位置を取得しましたが、フォルダから画像を取得できません。
public class quotes extends AppCompatActivity {
private ShareActionProvider mShareActionProvider;
Button btn;
ViewPager viewPager=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.quotes_pager);
btn = (Button) this.findViewById(R.id.share);
viewPager = (ViewPager) findViewById(R.id.pager);
viewPager.setAdapter(new CustomPagerAdapter(this));
btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("image/jpg");
int position=viewPager.getCurrentItem();
Uri uri = Uri.parse("@mipmap-hdpi/"+"apj"+position+".jpg");
sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(sharingIntent, "Share using"));
}
});
}
}
これは自分の画像フォルダです。ミップマップフォルダに画像を保存しました。それは何か問題を作る?表示されていない場合は、現在のビューページャ画像の位置を使用してそのフォルダから画像を取得する方法を教えてください。