Skip to content Skip to sidebar Skip to footer

Android Imageview Displays On Emulator But Not On Device

I am working in AndroidStudio trying to set an image to display on the screen after it is taken by the camera. This is working flawlessly on the emulator but when I test it on my d

Solution 1:

I'd suggest you to see if there is no memory problem due to loading your image. See this page from doc in order to reduce memory consumption when loading your image.

I had this problem too, the image was opened on other devices but not on my phone. Maybe by properly loading your bitmap, it will works.

Solution 2:

first check

google photo in nexus5 enable status?

if google photo setting's disable

can't file path's use & file open

(check : use file maneger on "file.getAbsolutePath()" )

can't gallery use, naxus's google account disable status

--

second textureView no use'd check

next code possible?

public class MainActivity extends Activity{

staticfinalintREQUEST_IMAGE_CAPTURE=1;
ImageView leftEye;

@OverrideprotectedvoidonCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    leftEye = (ImageView) findViewById(R.id.ghostAlign);
    dispatchTakePictureIntent();

}

privatevoiddispatchTakePictureIntent() {
    IntenttakePictureIntent=newIntent(MediaStore.ACTION_IMAGE_CAPTURE);
    if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
        startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
    }
}

@OverrideprotectedvoidonActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
        Bundleextras= data.getExtras();

        if(leftEye != null) {

            BitmapimageBitmap= (Bitmap) extras.get("data");
            leftEye.setImageBitmap(imageBitmap);

        }

    }
}

}

if Bitmap on imageview's see. i think, AbsolutePath error

Post a Comment for "Android Imageview Displays On Emulator But Not On Device"