Grundsätzlich versuche ich Java und Android App Entwicklung zu lernen. Kürzlich habe ich ein neues Projekt erstellt und ein einfaches Layout mit einem Button darin entworfen und es mit Hauptaktivität geladen.Die Anwendung möglicherweise zu viel Arbeit auf seine Haupt Thread Fehler auf neues Projekt
Jetzt bekomme ich folgende Fehler ohne sogar Knopffunktion und Sachen usw. zu implementieren. Es ist nur Laden und Anzeigen des Layouts, aber es dauert zu viel Zeit. Zum Beispiel: wenn ich es auf Simulator laden oder auf meiner Person Gerät .. es dauert ca. 10 Sekunden zu laden und dann, wenn ich eine Taste Anwendung überspringt Frames klicken ..
01/08 09:19:48: Launching app
No apk changes detected since last installation, skipping installation of C:\Users\nouma\AndroidStudioProjects\MediEase\app\build\outputs\apk\app-debug.apk
$ adb shell am force-stop com.example.nouma.mediease
$ adb shell am start -n "com.example.nouma.mediease/com.example.nouma.mediease.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 3520 on device Nexus_5X_API_23 [emulator-5554]
W/System: ClassLoader referenced unknown path: /data/app/com.example.nouma.mediease-2/lib/x86
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 01-08 09:19:49.686 3520: 3520 D/ ]
HostConnection::get() New Host Connection established 0xaab6ddc0, tid 3520
[ 01-08 09:19:49.746 3520: 3534 D/ ]
HostConnection::get() New Host Connection established 0xaff0d4e0, tid 3534
I/OpenGLRenderer: Initialized EGL, version 1.4
W/EGL_emulation: eglSurfaceAttrib not implemented
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xaa392b60, error=EGL_SUCCESS
I/Choreographer: Skipped 213 frames! The application may be doing too much work on its main thread.
I/Choreographer: Skipped 91 frames! The application may be doing too much work on its main thread.
I/Choreographer: Skipped 75 frames! The application may be doing too much work on its main thread.
I/Choreographer: Skipped 73 frames! The application may be doing too much work on its main thread.
I/Choreographer: Skipped 67 frames! The application may be doing too much work on its main thread.
I/Choreographer: Skipped 77 frames! The application may be doing too much work on its main thread.
I/Choreographer: Skipped 89 frames! The application may be doing too much work on its main thread.
-Code
package com.example.nouma.mediease;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
//private Button mainbutton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/* mainbutton = (Button)findViewById(R.id.begin_button);
mainbutton.setOnClickListener(
new Button.OnClickListener(){
public void onClick(View v){
startMain();
}
}
);*/
}
/*
*public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
Bitmap b = loadImageFromNetwork();
mImageView.setImageBitmap(b);
}
}).start();
}
* */
void startMain(){
Intent i = new Intent(this, introActivity.class);
startActivity(i);
finish();
}
}
XML-Datei: http://pastebin.com/cQ6fSmvg
Mögliche Duplikat [Die Anwendung macht zu viel Arbeit auf i kann ts Hauptthread] (http://stackoverflow.com/questions/14678593/the-application-may-be-doing-too-much-working-on-it-main-thread) –
Bitte setzen Sie Ihre Xml hier –
@Nouman Arshad ist alles was du hast und ist das die Startaktivität oder hast du vorher schon welche geladen und dann diese geladen? Ich sehe nur eine sentcontent Ansicht und alle anderen Zeilen kommentiert, so dass Sie diese Fehlermeldung erhalten.IF ja Ihre XML hat Probleme post it hier –