In the AndroidStudio emulator everything is loaded and works fine, but on the actual device (galaxy s 6 edge - in this case) only the second case is loaded (the case 1) the rest are not loaded. Maybe this is due to the size of the files? Maybe you need to register some permissions for files larger than 500kb? or something like that?

public class PortfolioFullScreenActivity extends AppCompatActivity { ImageView fullScreenImage; PhotoViewAttacher photoViewAttacher; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.portfolio_page_activity); fullScreenImage = (ImageView) findViewById(R.id.image_full_screen); Intent intent = getIntent(); int position = intent.getIntExtra("position", 0); switch (position){ case 0: Picasso.with(this) .load(R.drawable.social_trading) .resize(1080,1080) .into(fullScreenImage); break; case 1: Picasso.with(this) .load(R.drawable.nordex) .resize(1400,1287) .into(fullScreenImage); break; case 2: Picasso.with(this) .load(R.drawable.technolite) .resize(1080,2341) .into(fullScreenImage); break; case 3: Picasso.with(this) .load(R.drawable.sia_studio) .resize(1920,2136) .into(fullScreenImage); break; case 4: Picasso.with(this) .load(R.drawable.vavilon) .resize(1080,1928) .into(fullScreenImage); break; case 5: Picasso.with(this) .load(R.drawable.global_solution) .resize(1080,1224) .into(fullScreenImage); break; default: Toast.makeText(PortfolioFullScreenActivity.this, "Что-то пошло не так", Toast.LENGTH_SHORT).show(); break; } photoViewAttacher = new PhotoViewAttacher(fullScreenImage); } } 

Layout.xml

  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".Activities.PortfolioFullScreenActivity"> <ImageView android:id="@+id/image_full_screen" android:layout_width="match_parent" android:layout_height="match_parent" /> </RelativeLayout> 

UPD:

There is one more feature, after apk reinstallation, any picchu that you open first is displayed, and the rest are not, except case 1: it is always displayed.

  • And what means are not loaded? displayed as emptiness? - xAqweRx
  • @xAqweRx is displayed as void. - newakkoff
  • And what does the console say? NullPointerException7 - xAqweRx
  • For interest, try to transfer some of the options to the drawable folder - xAqweRx
  • @xAqweRx you probably did not understand correctly, they no longer appear on the real organization, everything works fine in the emulator - newakkoff

1 answer 1

Most likely the dimensions exceed the limit. The maximum allowable sizes depend on the device and can be recognized using OpenGL:

 int[] maxSize = new int[1]; gl.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSize, 0); 
  • @new No, there should be no such restrictions on the emulator - Stas Lelyuk
  • There is one more feature, after apk reinstallation, any picchu you open first is displayed, and the rest are not, except case 1: it is always displayed - newakkoff
  • @new Do not forget about the memory limit for the application. Most likely, in your case, the first picture consumes most of this memory. Thus, the second can no longer be displayed. The official documentation has some information on this topic. - Stas Lelyuk
  • Yes, apparently the problem is this, I decided simply, with photoshop and resave in a smaller size. Thank you! - newakkoff