How to share image of imageview?

后端 未结 6 1881
余生分开走
余生分开走 2021-01-14 16:47

I have ImageView and I want to share its image.

Following is my code,

btshare.setOnClickListener(new OnClickListener() {

        @Override
                 


        
6条回答
  •  悲哀的现实
    2021-01-14 17:35

    Bundle intent = getIntent().getExtras();
    cardView = (CardView) findViewById(R.id.card);
    final String query = intent.getString("Query1");
    
    db = new DataBaseHelper(Image.this);
    
    Cursor c = db.getData(query);
    
    if (c.getCount() != 0) {
        c.moveToFirst();
    
        do {
            image = c.getString(5);
            title=c.getString(3);
        } while (c.moveToNext());
    }
    
    txt.setText(title);
    
    img.setImageDrawable(getResources()
        .getDrawable(getResources().getIdentifier(image, "drawable", getPackageName())));
    

提交回复
热议问题