Android:应用程序运行在模拟器,但崩溃在我的手机上 [英] Android: App runs on emulator but it crashes on my mobile phone

查看:5153
本文介绍了Android:应用程序运行在模拟器,但崩溃在我的手机上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程式可在模拟器Nexus 5(Android 7.0,API 24)上运作,但当我尝试使用「onClick」开启其他活动时,会在我的手机(Samsung J5 Android 5.1.1)上发生错误。



这是导致崩溃的活动

  public class CuboActivity extends AppCompatActivity {
/ **
* {@link android.support.v4.view.PagerAdapter}将为每个节提供
*片段。我们使用
* {@link FragmentPagerAdapter}导数,它将每个
*加载的片段保存在内存中。如果这太内存密集,它
*可能最好切换到
* {@link android.support.v4.app.FragmentStatePagerAdapter}。
* /
private SectionsPagerAdapter mSectionsPagerAdapter;

/ **
*将承载节内容的{@link ViewPager}。
* /
private ViewPager mViewPager;

@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cubo);
Toast.makeText(getApplicationContext(),Premi le foto per vederle ingradite oppure visita il menu per vederle una dopo l'altra,Toast.LENGTH_LONG).show();
工具栏toolbar =(工具栏)findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
//创建将为活动的三个
//主要部分中的每一个返回一个片段的适配器。
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

//使用段适配器设置ViewPager。
mViewPager =(ViewPager)findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);

TabLayout tabLayout =(TabLayout)findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
}

@Override
public boolean onCreateOptionsMenu(菜单菜单){
//膨胀菜单;这会将条目添加到操作栏(如果存在)。
getMenuInflater()。inflate(R.menu.menu_cubo,menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item){
//处理操作栏项目点击这里。操作栏将
//自动处理Home / Up按钮上的点击,所以long
//在AndroidManifest.xml中指定一个父活动。
Toast.makeText(getApplicationContext(),Per alcune immagini gira il telefono,Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this,FotoCuboActivity.class);
startActivity(intent);
return super.onOptionsItemSelected(item);
}

/ **
*包含简单视图的占位符片段。
* /
public static class PlaceholderFragment extends Fragment {
/ **
*表示此
*片段的段号的片段参数。
* /
private static final String ARG_SECTION_NUMBER =section_number;

public PlaceholderFragment(){
}

/ **
*返回给定段的此片段的新实例
*数。
* /
public static PlaceholderFragment newInstance(int sectionNumber){
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER,sectionNumber);
fragment.setArguments(args);
return fragment;
}

@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container,
Bundle savedInstanceState)
{
switch(getArguments .getInt(ARG_SECTION_NUMBER))
{
case 1:
查看rootView = inflater.inflate(R.layout.fragment_cubo,container,false);
return rootView;

case 2:
查看rootView2 = inflater.inflate(R.layout.fragment_cubo2,container,false);
return rootView2;

case 3:
查看rootView3 = inflater.inflate(R.layout.fragment_cubo3,container,false);
return rootView3;

case 4:
查看rootView4 = inflater.inflate(R.layout.fragment_cubo4,container,false);
return rootView4;

默认值:
查看rootView0 = inflater.inflate(R.layout.fragment_cubo,container,false);
return rootView0;
}
}
}

/ **
* {@link FragmentPagerAdapter}返回对应于
的片段*章节/选项卡/页面。
* /
public class SectionsPagerAdapter extends FragmentPagerAdapter {

public SectionsPagerAdapter(FragmentManager fm){
super(fm);
}

@Override
public Fragment getItem(int position){
//调用getItem来为给定页面实例化片段。
//返回一个PlaceholderFragment(定义为下面的静态内部类)。
return PlaceholderFragment.newInstance(position + 1);
}

@Override
public int getCount(){
//显示3页总计。
return 4;
}

@Override
public CharSequence getPageTitle(int position){
switch(position){
case 0:
returnCONSEGNA ;
case 1:
returnLAVORO;
case 2:
returnRISULTATO;
case 3:
returnRELAZIONE;
}
return null;
}
}

public void onClick(View arg0)
{
switch(arg0.getId())
{
case R.id.segaCircolare:
Intent intent = new Intent(this,FragmentCuboActivity.class);
startActivity(intent);
break;
case R.id.lavorazioneCubo:
Intent intent2 = new Intent(this,FragmentCubo2Activity.class);
startActivity(intent2);
break;
case R.id.prodottiFiniti:
Toast.makeText(getApplicationContext(),Gira il telefono,Toast.LENGTH_SHORT).show();
Intent intent3 = new Intent(this,FragmentCubo3Activity.class);
startActivity(intent3);
break;
case R.id.modelloCubo:
Intent intent4 = new Intent(this,FragmentCubo4Activity.class);
startActivity(intent4);
break;
case R.id.cuboAlto:
Intent intent5 = new Intent(this,FragmentCubo5Activity.class);
startActivity(intent5);
break;
case R.id.cuboFrontale:
Intent intent6 = new Intent(this,FragmentCubo6Activity.class);
startActivity(intent6);
break;
case R.id.cuboIntermedio:
Intent intent7 = new Intent(this,FragmentCubo7Activity.class);
startActivity(intent7);
break;
case R.id.bottoneRelazione:
Uri uri = Uri.parse(https://docs.google.com/document/d/1J4KJJRzSnY5PSdQYoh6hrTKarl0ID0dtX8TqLga6-dY/edit?usp=sharing);
Intent intent0 = new Intent(Intent.ACTION_VIEW,uri);
startActivity(intent0);
break;
}
}
}

活动

 <?xml version =1.0encoding =utf-8?& 
< LinearLayout xmlns:android =http://schemas.android.com/apk/res/android
android:layout_width =match_parent
android:layout_height =match_parent
android:orientation =vertical>

< TextView
android:text =@ string / Procedimento1
android:layout_width =321dp
android:layout_height =wrap_content
android:id =@ + id / textView14
android:layout_gravity =center
android:layout_marginTop =15dp
android:gravity =center/>

< ImageView
android:layout_width =100dp
android:layout_height =100dp
android:background =@ drawable / lavorazionecubo
android:id =@ + id / lavorazioneCubo
android:layout_marginTop =15dp
android:layout_gravity =center
android:contentDescription =@ string / Vuoto
android:onClick =onClick/>

< TextView
android:text =@ string / Procedimento2
android:layout_width =351dp
android:layout_height =wrap_content
android:id =@ + id / textView15
android:layout_gravity =center
android:layout_marginTop =15dp
android:gravity =center/>

< RelativeLayout
android:orientation =horizo​​ntal
android:layout_width =match_parent
android:layout_height =match_parent
android: layout_marginTop =15dp>

< ImageView
android:layout_width =100dp
android:layout_height =100dp
Android:background =@ drawable / modellocubo
android:id =@ + id / modelloCubo
android:layout_alignParentTop =true
android:layout_alignParentRight =true
android:layout_alignParentEnd =true
:layout_marginRight =40dp
android:layout_marginEnd =40dp
android:contentDescription =@ string / Vuoto
android:onClick =onClick/>

< ImageView
android:layout_width =100dp
android:layout_height =100dp
android:background =@ drawable / prodottifiniti
android:id =@ + id / prodottiFiniti
android:layout_marginLeft =40dp
android:layout_marginStart =40dp
android:layout_alignParentTop =true
:layout_alignParentLeft =true
android:layout_alignParentStart =true
android:contentDescription =@ string / Vuoto
android:onClick =onClick/>

< / RelativeLayout>
< / LinearLayout>

这是上一个活动因为崩溃而无法打开的活动之一



> public class FragmentCubo2Activity extends AppCompatActivity {

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

这是它的布局

 <?xml version =1.0encoding =utf-8?> 
< LinearLayout xmlns:android =http://schemas.android.com/apk/res/android
android:layout_width =match_parent
android:layout_height =match_parent
android:background =@ drawable / lavorazionecubo>
< / LinearLayout>

这是logcat

  12-28 15:46:49.267 2751-2751 /? I / art:not late-enabling -Xcheck:jni(already on)
12-28 15:46:49.267 2751-2751 /? W / art:X86的意外CPU变量使用默认值:x86
12-28 15:46:49.326 2751-2751 / com.example.utente.progettigscorsipa W /系统:ClassLoader引用未知路径:/ data / app / com.example.utente.progettigscorsipa-2 / lib / x86
12-28 15:46:49.332 2751-2751 / com.example.utente.progettigscorsipa I / InstantRun:Instant Run运行时开始。 Android包是com.example.utente.progettigscorsipa,实际应用程序类是null。
12-28 15:46:50.278 2751-2751 / com.example.utente.progettigscorsipa W /系统:ClassLoader引用未知路径:/data/app/com.example.utente.progettigscorsipa-2/lib/x86
12-28 15:46:50.546 2751-2751 / com.example.utente.progettigscorsipa W / art:Android 4.1之前,方法android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android .graphics.PorterDuffColorFilter,android.content.res.ColorStateList,android.graphics.PorterDuff $ Mode)会不正确地覆盖android.graphics.drawable.Drawable中的package-private方法
12-28 15:46:50.793 2751-2780 / com.example.utente.progettigscorsipa I / OpenGLRenderer:初始化EGL版本1.4
12-28 15:46:50.793 2751-2780 / com.example.utente.progettigscorsipa D / OpenGLRenderer:交换行为1
12-28 15:46:50.948 2751-2780 / com.example.utente.progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):error 0x3009(EGL_BAD_MATCH)
12-28 15:46 :50.948 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer:无法在表面0x8e7ce4a0上设置EGL_SWAP_BEHAVIOR,错误= EGL_BAD_MATCH
12-28 15:46:50.998 2751-2780 / com.example.utente。 progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):错误0x3009(EGL_BAD_MATCH)
12-28 15:46:50.998 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer:无法设置EGL_SWAP_BEHAVIOR表面0x8e7ce4e0,错误= EGL_BAD_MATCH
12-28 15:49:16.811 2751-2780 / com.example.utente.progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):error 0x3009(EGL_BAD_MATCH)
12-28 15:49:16.811 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer:无法在表面0x8edc9100上设置EGL_SWAP_BEHAVIOR,错误= EGL_BAD_MATCH
12-28 15:49:19.918 2751-2780 / com.example.utente.progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):error 0x3009(EGL_BAD_MATCH)
12-28 15:49:19.918 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer :无法在表面0x9ce3cae0上设置EGL_SWAP_BEHAVIOR,错误= EGL_BAD_MATCH
12-28 15:49:19.993 2751-2780 / com.example.utente.progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):error 0x3009 EGL_BAD_MATCH)
12-28 15:49:19.993 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer:无法在表面0x9b091060上设置EGL_SWAP_BEHAVIOR,错误= EGL_BAD_MATCH
12-28 15:49 :20.017 2751-2751 / com.example.utente.progettigscorsipa I / Choreographer:Skipped 55 frames!应用程序可能在其主线程上做太多的工作。
12-28 15:49:25.376 2751-2751 / com.example.utente.progettigscorsipa I / Choreographer:跳过78帧!应用程序可能在其主线程上做太多的工作。
12-28 15:49:26.001 2751-2751 / com.example.utente.progettigscorsipa I /编舞:跳过36帧!应用程序可能在其主线程上做太多的工作。
12-28 15:49:26.598 2751-2751 / com.example.utente.progettigscorsipa I /编舞:跳过34帧!应用程序可能在其主线程上做太多的工作。
12-28 15:49:29.638 2751-2780 / com.example.utente.progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):error 0x3009(EGL_BAD_MATCH)
12-28 15:49 :29.638 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer:无法在表面0x9ce3cac0上设置EGL_SWAP_BEHAVIOR,错误= EGL_BAD_MATCH
12-28 15:49:32.900 2751-2780 / com.example.utente。 progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):错误0x3009(EGL_BAD_MATCH)
12-28 15:49:32.900 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer:无法设置EGL_SWAP_BEHAVIOR表面0x9ce3cae0,错误= EGL_BAD_MATCH
12-28 15:49:34.947 2751-2780 / com.example.utente.progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):error 0x3009(EGL_BAD_MATCH)
12-28 15:49:34.947 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer:无法在表面0x8baf1c00上设置EGL_SWAP_BEHAVIOR,错误= EGL_BAD_MATCH
12-28 15:49:35.386 2751-2780 / com.example.utente.progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):error 0x3009(EGL_BAD_MATCH)
12-28 15:49:35.386 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer :无法在表面0x9ce3c380上设置EGL_SWAP_BEHAVIOR,错误= EGL_BAD_MATCH
12-28 15:49:38.009 2751-2780 / com.example.utente.progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):error 0x3009 EGL_BAD_MATCH)
12-28 15:49:38.009 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer:无法在表面0x8baf1c00上设置EGL_SWAP_BEHAVIOR,错误= EGL_BAD_MATCH
12-28 15:49 :40.678 2751-2780 / com.example.utente.progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib(1146):error 0x3009(EGL_BAD_MATCH)
12-28 15:49:40.678 2751-2780 / com。 utente.progettigscorsipa W / OpenGLRenderer:无法在表面0x9ce3cae0上设置EGL_SWAP_BEHAVIOR,错误= EGL_BAD_MATCH
12-28 15:49:43.712 2751-2780 / com.example.utente.progettigscorsipa E / EGL_emulation:tid 2780:eglSurfaceAttrib 1146):错误0x3009(EGL_BAD_MATCH)
12-28 15:49:43.713 2751-2780 / com.example.utente.progettigscorsipa W / OpenGLRenderer:无法在表面0x8baf1c00上设置EGL_SWAP_BEHAVIOR,错误= EGL_BAD_MATCH

我解决了我的问题,这是我的手机的一个问题,它didn没有足够的记忆


My app works on the emulator Nexus 5(Android 7.0, API 24) but it crashes on my mobile phone(Samsung J5 Android 5.1.1) in a precise activity when I try to open another activity with an "onClick".

This is the activity which crashes

public class CuboActivity extends AppCompatActivity {
    /**
     * The {@link android.support.v4.view.PagerAdapter} that will provide
     * fragments for each of the sections. We use a
     * {@link FragmentPagerAdapter} derivative, which will keep every
     * loaded fragment in memory. If this becomes too memory intensive, it
     * may be best to switch to a
     * {@link android.support.v4.app.FragmentStatePagerAdapter}.
     */
    private SectionsPagerAdapter mSectionsPagerAdapter;

    /**
     * The {@link ViewPager} that will host the section contents.
     */
    private ViewPager mViewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cubo);
        Toast.makeText(getApplicationContext(),"Premi le foto per vederle ingradite oppure visita il menu per vederle una dopo l'altra",Toast.LENGTH_LONG).show();
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        // Create the adapter that will return a fragment for each of the three
        // primary sections of the activity.
        mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

        // Set up the ViewPager with the sections adapter.
        mViewPager = (ViewPager) findViewById(R.id.container);
        mViewPager.setAdapter(mSectionsPagerAdapter);

        TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
        tabLayout.setupWithViewPager(mViewPager);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_cubo, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        Toast.makeText(getApplicationContext(),"Per alcune immagini gira il telefono",Toast.LENGTH_SHORT).show();
        Intent intent = new Intent(this, FotoCuboActivity.class);
        startActivity(intent);
        return super.onOptionsItemSelected(item);
    }

    /**
     * A placeholder fragment containing a simple view.
     */
    public static class PlaceholderFragment extends Fragment {
        /**
         * The fragment argument representing the section number for this
         * fragment.
         */
        private static final String ARG_SECTION_NUMBER = "section_number";

        public PlaceholderFragment() {
        }

        /**
         * Returns a new instance of this fragment for the given section
         * number.
         */
        public static PlaceholderFragment newInstance(int sectionNumber) {
            PlaceholderFragment fragment = new PlaceholderFragment();
            Bundle args = new Bundle();
            args.putInt(ARG_SECTION_NUMBER, sectionNumber);
            fragment.setArguments(args);
            return fragment;
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                 Bundle savedInstanceState)
        {
            switch (getArguments().getInt(ARG_SECTION_NUMBER))
            {
                case 1:
                    View rootView = inflater.inflate(R.layout.fragment_cubo, container, false);
                    return rootView;

                case 2:
                    View rootView2 = inflater.inflate(R.layout.fragment_cubo2, container, false);
                    return rootView2;

                case 3:
                    View rootView3 = inflater.inflate(R.layout.fragment_cubo3, container, false);
                    return rootView3;

                case 4:
                    View rootView4 = inflater.inflate(R.layout.fragment_cubo4, container, false);
                    return rootView4;

                default:
                    View rootView0 = inflater.inflate(R.layout.fragment_cubo, container, false);
                    return rootView0;
            }
        }
    }

    /**
     * A {@link FragmentPagerAdapter} that returns a fragment corresponding to
     * one of the sections/tabs/pages.
     */
    public class SectionsPagerAdapter extends FragmentPagerAdapter {

        public SectionsPagerAdapter(FragmentManager fm) {
            super(fm);
        }

        @Override
        public Fragment getItem(int position) {
            // getItem is called to instantiate the fragment for the given page.
            // Return a PlaceholderFragment (defined as a static inner class below).
            return PlaceholderFragment.newInstance(position + 1);
        }

        @Override
        public int getCount() {
            // Show 3 total pages.
            return 4;
        }

        @Override
        public CharSequence getPageTitle(int position) {
            switch (position) {
                case 0:
                    return "CONSEGNA";
                case 1:
                    return "LAVORO";
                case 2:
                    return "RISULTATO";
                case 3:
                    return "RELAZIONE";
            }
            return null;
        }
    }

    public void onClick(View arg0)
    {
        switch(arg0.getId())
        {
            case R.id.segaCircolare:
                Intent intent = new Intent(this,FragmentCuboActivity.class);
                startActivity(intent);
                break;
            case R.id.lavorazioneCubo:
                Intent intent2 = new Intent(this,FragmentCubo2Activity.class);
                startActivity(intent2);
                break;
            case R.id.prodottiFiniti:
                Toast.makeText(getApplicationContext(),"Gira il telefono",Toast.LENGTH_SHORT).show();
                Intent intent3 = new Intent(this,FragmentCubo3Activity.class);
                startActivity(intent3);
                break;
            case R.id.modelloCubo:
                Intent intent4 = new Intent(this,FragmentCubo4Activity.class);
                startActivity(intent4);
                break;
            case R.id.cuboAlto:
                Intent intent5 = new Intent(this,FragmentCubo5Activity.class);
                startActivity(intent5);
                break;
            case R.id.cuboFrontale:
                Intent intent6 = new Intent(this,FragmentCubo6Activity.class);
                startActivity(intent6);
                break;
            case R.id.cuboIntermedio:
                Intent intent7 = new Intent(this,FragmentCubo7Activity.class);
                startActivity(intent7);
                break;
            case R.id.bottoneRelazione:
                Uri uri = Uri.parse("https://docs.google.com/document/d/1J4KJJRzSnY5PSdQYoh6hrTKarl0ID0dtX8TqLga6-dY/edit?usp=sharing");
                Intent intent0 = new Intent(Intent.ACTION_VIEW, uri);
                startActivity(intent0);
                break;
        }
    }
}

This is the layout of this activity

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:text="@string/Procedimento1"
        android:layout_width="321dp"
        android:layout_height="wrap_content"
        android:id="@+id/textView14"
        android:layout_gravity="center"
        android:layout_marginTop="15dp"
        android:gravity="center" />

    <ImageView
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="@drawable/lavorazionecubo"
        android:id="@+id/lavorazioneCubo"
        android:layout_marginTop="15dp"
        android:layout_gravity="center"
        android:contentDescription="@string/Vuoto"
        android:onClick="onClick"/>

    <TextView
        android:text="@string/Procedimento2"
        android:layout_width="351dp"
        android:layout_height="wrap_content"
        android:id="@+id/textView15"
        android:layout_gravity="center"
        android:layout_marginTop="15dp"
        android:gravity="center" />

    <RelativeLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="15dp">

        <ImageView
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="@drawable/modellocubo"
            android:id="@+id/modelloCubo"
            android:layout_alignParentTop="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:layout_marginRight="40dp"
            android:layout_marginEnd="40dp"
            android:contentDescription="@string/Vuoto"
            android:onClick="onClick"/>

        <ImageView
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="@drawable/prodottifiniti"
            android:id="@+id/prodottiFiniti"
            android:layout_marginLeft="40dp"
            android:layout_marginStart="40dp"
            android:layout_alignParentTop="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:contentDescription="@string/Vuoto"
            android:onClick="onClick" />

    </RelativeLayout>
</LinearLayout>

This is one of the activities which the previous activity doesn't open because it crashes

public class FragmentCubo2Activity extends AppCompatActivity {

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

And this is its layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/lavorazionecubo">
</LinearLayout>

This is the logcat

12-28 15:46:49.267 2751-2751/? I/art: Not late-enabling -Xcheck:jni (already on)
12-28 15:46:49.267 2751-2751/? W/art: Unexpected CPU variant for X86 using defaults: x86
12-28 15:46:49.326 2751-2751/com.example.utente.progettigscorsipa W/System: ClassLoader referenced unknown path: /data/app/com.example.utente.progettigscorsipa-2/lib/x86
12-28 15:46:49.332 2751-2751/com.example.utente.progettigscorsipa I/InstantRun: Instant Run Runtime started. Android package is com.example.utente.progettigscorsipa, real application class is null.
12-28 15:46:50.278 2751-2751/com.example.utente.progettigscorsipa W/System: ClassLoader referenced unknown path: /data/app/com.example.utente.progettigscorsipa-2/lib/x86
12-28 15:46:50.546 2751-2751/com.example.utente.progettigscorsipa W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
12-28 15:46:50.793 2751-2780/com.example.utente.progettigscorsipa I/OpenGLRenderer: Initialized EGL, version 1.4
12-28 15:46:50.793 2751-2780/com.example.utente.progettigscorsipa D/OpenGLRenderer: Swap behavior 1
12-28 15:46:50.948 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:46:50.948 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x8e7ce4a0, error=EGL_BAD_MATCH
12-28 15:46:50.998 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:46:50.998 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x8e7ce4e0, error=EGL_BAD_MATCH
12-28 15:49:16.811 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:49:16.811 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x8edc9100, error=EGL_BAD_MATCH
12-28 15:49:19.918 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:49:19.918 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x9ce3cae0, error=EGL_BAD_MATCH
12-28 15:49:19.993 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:49:19.993 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x9b091060, error=EGL_BAD_MATCH
12-28 15:49:20.017 2751-2751/com.example.utente.progettigscorsipa I/Choreographer: Skipped 55 frames!  The application may be doing too much work on its main thread.
12-28 15:49:25.376 2751-2751/com.example.utente.progettigscorsipa I/Choreographer: Skipped 78 frames!  The application may be doing too much work on its main thread.
12-28 15:49:26.001 2751-2751/com.example.utente.progettigscorsipa I/Choreographer: Skipped 36 frames!  The application may be doing too much work on its main thread.
12-28 15:49:26.598 2751-2751/com.example.utente.progettigscorsipa I/Choreographer: Skipped 34 frames!  The application may be doing too much work on its main thread.
12-28 15:49:29.638 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:49:29.638 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x9ce3cac0, error=EGL_BAD_MATCH
12-28 15:49:32.900 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:49:32.900 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x9ce3cae0, error=EGL_BAD_MATCH
12-28 15:49:34.947 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:49:34.947 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x8baf1c00, error=EGL_BAD_MATCH
12-28 15:49:35.386 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:49:35.386 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x9ce3c380, error=EGL_BAD_MATCH
12-28 15:49:38.009 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:49:38.009 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x8baf1c00, error=EGL_BAD_MATCH
12-28 15:49:40.678 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:49:40.678 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x9ce3cae0, error=EGL_BAD_MATCH
12-28 15:49:43.712 2751-2780/com.example.utente.progettigscorsipa E/EGL_emulation: tid 2780: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
12-28 15:49:43.713 2751-2780/com.example.utente.progettigscorsipa W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x8baf1c00, error=EGL_BAD_MATCH

解决方案

I solved my problem, it was a problem of my mobile, it didn't have enough memory

这篇关于Android:应用程序运行在模拟器,但崩溃在我的手机上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆