Image sharing of a listview with Intent

0

Please help me please. I have a listview with several images and hence when the user selects an image in the list in the app, this image is assigned to an ID in the case R.id.ivCar and at the time of passing the reference in the attempt is giving error because can not pass id with reference You have to pass the image. Good how do I do this? follow the code ..

int resId = R.id.iv_car; // car.getIMAGEMRESOUCEID()
Uri uriToImage = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE +
                                "://" + getResources().getResourcePackageName(resId));
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uriToImage);
shareIntent.setType("image/jpeg");
startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.app_name)));

Help me pfvvvvv ... I've done everything to

    
asked by anonymous 05.05.2016 / 04:41

1 answer

0

To pass data to a selected try from a listview I did it that way

ltsunidades.setOnItemClickListener(new AdapterView.OnItemClickListener() {

    @Override
    public void onItemClick(AdapterView adapter, View view, int posicao, long id) {
        Tab_UC obj = (Tab_UC) adapter.getItemAtPosition(posicao);
        String filial = "" + obj.getCod_UC();

        Preferencia.setfilial(Selecionar_Unidade.this, filial.toString().trim());

        Intent it = new Intent(getBaseContext(), Empresa.class);
        it.putExtra("Filial", filial);
        startActivity(it);
        // Toast.makeText(getApplicationContext(), " " + filial, Toast.LENGTH_SHORT).show();
    }
});

In my case I'm getting a code that needs a select done in php via web service and I'm already saving it in a sharedpreferences ..

    
05.05.2016 / 13:27