小编Ars*_*iya的帖子

java.lang.OutOfMemoryError - How do I fix this?

I am trying to implement paging in one activity but I keep running out of memory. The app runs till the 4th page but when it gets to the 5th it crashes. I've tried increasing the JVM heap size but the app still crashes at this one point where it runs out of memory to allocate.

This is my main file:

public class S1Intro extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_s1);

    MyPagerAdapter adapter = new MyPagerAdapter(); …
Run Code Online (Sandbox Code Playgroud)

java android out-of-memory android-imageview android-bitmap

-1
推荐指数
2
解决办法
1168
查看次数