W / OpenGLRenderer:使用EGL_SWAP_BEHAVIOR_PRESERVED选择配置失败,不进行重试

时间:2018-09-17 10:18:19

标签: android xml android-layout imageview

我想构建教师助手应用程序,当尝试运行我的项目时,模拟器停止并显示此日志

$ adb install-multiple -r -t -p com.andisofttechnology.myapplication C:\Users\Alfraganus\AndroidStudioProjects\MyApplication\app\build\intermediates\split-apk\debug\slices\slice_9.apk C:\Users\Alfraganus\AndroidStudioProjects\MyApplication\app\build\outputs\apk\debug\app-debug.apk 
Split APKs installed
$ adb shell am start -n "com.andisofttechnology.myapplication/com.andisofttechnology.myapplication.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 15938 on device emulator-5554
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/InstantRun: starting instant run server: is main process
D/OpenGLRenderer: HWUI GL Pipeline
I/zygote: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/EGL_emulation: eglCreateContext: 0xae0625a0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xae0625a0: ver 3 0 (tinfo 0xa614b5c0)
D/EGL_emulation: eglMakeCurrent: 0xae0625a0: ver 3 0 (tinfo 0xa614b5c0)
D/EGL_emulation: eglMakeCurrent: 0xae0625a0: ver 3 0 (tinfo 0xa614b5c0)

主要活动

 package com.andisofttechnology.myapplication;    
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {
    private ImageView btnCheck,btnRegister,btnNote,btnSchedule;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


     ImageView btnRegister = (ImageView)findViewById(R.id.btnRegister);

     btnRegister.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View v) {
             Intent Register = new Intent(MainActivity.this,Student_Registartion.class);
             startActivity(Register);
         }
     });

主要activity.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true"
    >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"

        >


        <ImageView
            android:id="@+id/btnCheck"
            android:layout_width="180dp"
            android:layout_height="250dp"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="11dp"
            android:layout_marginStart="11dp"
            android:src="@drawable/attend200" />

        <ImageView
            android:id="@+id/btnSchedul"
            android:layout_width="180dp"


            android:layout_height="200dp"
            android:layout_alignLeft="@+id/btnCheck"
            android:layout_alignStart="@+id/btnCheck"
            android:layout_below="@+id/btnCheck"
            android:layout_marginTop="22dp"
            android:src="@drawable/schedule" />

        <ImageView
            android:id="@+id/btnRegister"
            android:clickable="true"
            android:onClick="btnRegister"
            android:layout_width="170dp"
            android:layout_height="200dp"
            android:layout_alignTop="@+id/btnSchedul"
            android:layout_marginLeft="11dp"
            android:layout_marginStart="11dp"
            android:layout_toEndOf="@+id/btnSchedul"
            android:layout_toRightOf="@+id/btnSchedul"
            android:src="@drawable/profile" />

        <ImageView
            android:id="@+id/btnNote"
            android:layout_width="150dp"

            android:layout_height="200dp"
            android:layout_above="@+id/btnSchedul"
            android:layout_alignLeft="@+id/btnRegister"
            android:layout_alignStart="@+id/btnRegister"
            android:layout_marginBottom="15dp"
            android:src="@drawable/notes" />

        <TextView
            android:id="@+id/textView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/btnNote"
            android:layout_alignLeft="@+id/textView4"
            android:layout_alignStart="@+id/textView4"
            android:layout_marginLeft="16dp"
            android:layout_marginStart="16dp"
            android:text="Davomat"
            android:textSize="24dp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/textView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/textView5"
            android:layout_alignStart="@+id/textView5"
            android:layout_alignTop="@+id/textView"
            android:layout_marginLeft="13dp"
            android:layout_marginStart="13dp"
            android:text="Eslatmalar"
            android:textSize="24dp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/textView4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/btnSchedul"
            android:layout_alignLeft="@+id/btnSchedul"
            android:layout_alignStart="@+id/btnSchedul"
            android:layout_marginLeft="20dp"
            android:layout_marginStart="20dp"
            android:text="Dars Jadvali"
            android:textSize="24dp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/textView5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/btnRegister"
            android:layout_alignEnd="@+id/btnRegister"
            android:layout_alignRight="@+id/btnRegister"
            android:text="Ro'yhatga olish"
            android:textSize="24dp"
            android:textStyle="bold" />

    </RelativeLayout>


</RelativeLayout>

清单

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.andisofttechnology.myapplication"
    >
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Student_Registartion">

        </activity>
    </application>

</manifest>

............................................... ................................................... ................................................... ................................................... ............................................

0 个答案:

没有答案