Parse.com Highscore Liste in einer ListView anzeigen?

M

Massym

Neues Mitglied
0
Hallo,
ich bin ein Anfäger und habe kaum erfahrung mit Programmiersprachen. Kämpfe mich seit 2 Monaten durch zahlreiche Foren und Tutarials...nun bin ich dabei Highscore Daten von Parse.com auszulesen und in einer ListView anzuzeigen (das die Liste noch sortiert werden muss und der gleichen ist mir im moment noch egal)... das habe ich auch teilweise hinbekommen aber meine ListView ist im emulator mal sichtbar und mal nicht sichtbar, auf meinem Handy ist sie nie zu sehen! Ich versuche jetzt seit bald 2 Wochen das hinzubekommen, bin mitlerweile wirklich verzweifelt und weiss nicht mehr weiter...

Hier mein Code, vieleicht sieht ja jemand meinen fahler und kann mir weiter helfen:

Code:
[B]Meine HighscoreActivity.java[/B]

public class HighscoreActivity extends Activity {

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

        ImageView HS_anim = (ImageView)findViewById(R.id.highscore_anim_view);
        final AnimationDrawable HighscoreAnimationDrawable
                = (AnimationDrawable)HS_anim.getDrawable();

        HS_anim.post(
                new Runnable(){

                    @Override
                    public void run() {
                        HighscoreAnimationDrawable.start();
                    }
                });

        final List<Score> scores = new ArrayList<Score>(0);
        ListView bibliothekLV = (ListView) findViewById(R.id.listView1);
        ScoreAdapter adapter = new ScoreAdapter(this.getApplicationContext(), R.layout.listviewadapter, scores);
        bibliothekLV.setAdapter(adapter);


        ParseQuery<ParseObject> query = ParseQuery.getQuery("Highscore");
        query.findInBackground(new FindCallback<ParseObject>() {
            public void done(List<ParseObject> parseObjectList, ParseException e) {
                if (e == null) {
                    int i = 1;

                    for (ParseObject highscore : parseObjectList) {
                        if (i == 1){  Score erster = new Score();
                            erster.setPlayer(highscore.getString("Player"));  erster.setLevel(highscore.getString("LVL"));
                            erster.setPunkte(highscore.getString("Punkte"));  i+=1; scores.add(erster);

                            Log.d("nummer 1", "OK");
                        }
                        if (i == 2){  Score zweiter = new Score();
                            zweiter.setPlayer(highscore.getString("Player"));  zweiter.setLevel(highscore.getString("LVL"));
                            zweiter.setPunkte(highscore.getString("Punkte"));  i+=1; scores.add(zweiter);

                            Log.d("nummer 2", "OK");
                        }
                        if (i == 3){  Score dritter = new Score();
                            dritter.setPlayer(highscore.getString("Player"));  dritter.setLevel(highscore.getString("LVL"));
                            dritter.setPunkte(highscore.getString("Punkte"));  i+=1; scores.add(dritter);

                            Log.d("nummer 3", "OK");
                            Log.d("Einträge", "erhalten " + parseObjectList.size() + " Eintrage");
                        }
                    }

                } else {
                    Log.d("score", "Error: " + e.getMessage());
                }
            }
        });

    }

    public class ScoreAdapter extends ArrayAdapter<Score> {

        Context context;
        int layoutResourceId;
        List<Score> data=null;


        public ScoreAdapter(Context context, int layoutResourceId, List<Score> data) {
            super(context, layoutResourceId, data);
            this.layoutResourceId = layoutResourceId;
            this.context = context;
            this.data = data;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View row = convertView;
            ScoreHolder holder = null;

            if(row == null)
            {
                LayoutInflater inflater = LayoutInflater.from(context);
                row = inflater.inflate(layoutResourceId, parent, false);

                holder = new ScoreHolder();
                holder.icon = (ImageView)row.findViewById(R.id.listview_icon);
                holder.playername = (TextView)row.findViewById(R.id.listview_name);
                holder.level = (TextView)row.findViewById(R.id.listview_lvl);
                holder.hochstpunkte = (TextView)row.findViewById(R.id.listview_punkte);

                row.setTag(holder);
            }
            else
            {
                holder = (ScoreHolder)row.getTag();
            }

            Score score = data.get(position);
            holder.playername.setText(score.getPlayer());
            holder.level.setText(score.getLevel());
            holder.hochstpunkte.setText(score.getPunkte());
            if(!(score.getBild()==null))
                holder.icon.setImageBitmap(score.getBild());
            else
                holder.icon.setImageResource(R.drawable.ic_launcher);

            return row;
        }

    }

    static class ScoreHolder
    {
        public TextView playername;
        public TextView level;
        public TextView hochstpunkte;
        public ImageView icon;
    }


    public class Score {

        private long id;
        private String player;
        private String titel;
        private String autor;
        private String punkte;
        private String lvl;
        private String comment;
        private Bitmap bild;
        private int status;
        private int ressource;

        public long getId() {
            return id;
        }
        public void setId(long id) {
            this.id = id;
        }

        public String getTitel() {
            return titel;
        }
        public void setTitel(String titel) {
            this.titel = titel;
        }

        public String getPlayer() {
            return player;
        }
        public void setPlayer(String player) {
            this.player = player;
        }

        public String getAutor() {
            return autor;
        }
        public void setAutor(String autor) {
            this.autor = autor;
        }


        public String getPunkte() {
            return punkte;
        }
        public void setPunkte(String punkte) {
            this.punkte = punkte;
        }

        public String getLevel() {
            return lvl;
        }
        public void setLevel(String lvl) {
            this.lvl = lvl;
        }

        public String getBeschreibung() {
            return comment;
        }
        public void setBeschreibung(String Beschreibung) {
            this.comment = Beschreibung;
        }

        public Bitmap getBild() {
            return bild;
        }
        public void setBild(Bitmap bild) {
            this.bild = bild;
        }

        public Integer getStatus() {
            return status;
        }
        public void setStatus(int status) {
            this.status = status;
        }

        public Integer getRessource() {
            return ressource;
        }
        public void setRessource(int ressource) {
            this.ressource = ressource;
        }
    }
}

[B]Meine Highscore.xml datei[/B]:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:weightSum="1"
    android:orientation="vertical"
    tools:context=".MainActivity"
    android:background="#ff75bcf0"
    android:id="@+id/frameLayout">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:layout_gravity="center_horizontal"
        android:gravity="center"
        android:layout_weight="1.44">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center">

            <ImageView
                android:layout_width="280dp"
                android:layout_height="60dp"
                android:id="@+id/highscore_anim_view"
                android:layout_gravity="center_horizontal"
                android:src="@drawable/highscore_title_anim" />
        </LinearLayout>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="386dp"
        android:layout_gravity="center_horizontal"
        android:gravity="center">

        <ListView
            android:layout_height="315dp"
            android:layout_width="298dp"
            android:id="@+id/listView1" />

    </LinearLayout>

</LinearLayout>

[B]Meine listviewadapter.xml datei:[/B]

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:paddingTop="10dp"
    android:id="@+id/listview_buch"
    android:gravity="center|left">

    <ImageView
        android:id="@+id/listview_icon"
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:src="@drawable/ic_launcher"
        android:layout_gravity="center_vertical|left" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingLeft="4dp"
        android:weightSum="1">

        <TextView
            android:id="@+id/listview_name"
            android:layout_width="120dp"
            android:layout_height="match_parent"
            android:text="@+id/listview_titel"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#ffff6923"
            android:layout_gravity="bottom|left"
            android:gravity="left" />

        <TextView
            android:id="@+id/listview_lvl"
            android:layout_width="60dp"
            android:layout_height="match_parent"
            android:text="@+id/listview_subtitel"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:layout_weight="11.33"
            android:layout_gravity="center_horizontal"
            android:gravity="center" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="Large Text"
            android:id="@+id/listview_punkte"
            android:layout_weight="13.08"
            android:gravity="right" />

    </LinearLayout>

</LinearLayout>

AABFXz4oBrczd_3nbPofguRya
AABFXz4oBrczd_3nbPofguRya
 
Alsooooo,...

1) Zunächst einmal poste doch bitte unbedingt ein Logcat, wenn die Listview nicht angezeigt wird.
2) In dem Zusammenhang, siehst Du (wenn die Listview denn mal sichtbar ist) auch deine Debug Meldungen?
3) Du hast geschrieben, dass die Listview nicht angezeigt wird. Enthält sie denn Daten, wenn sie da ist?
4) Was passiert (sollte passieren), wenn - warum auch immer - keine Daten da sind. Wird dann eine leere Listview angezeigt oder gar nix?


Ansonsten fang ich mal an:

Hier bibliothekLV.setAdapter(adapter); setzt Du den Adapter und erst danach führst Du deine ParseQuery aus und erhälst so die Scoredaten.
Sofern da also nicht irgendwo später ein bibliothekLV.notifyDataSetChanged(); kommt, würde ich erwarten, dass deine Liste eh immer leer ist.
Also erst die ParseQuery und dann den Adapter (oder halt .notifyDataSetChanged() verwenden).

Deine For Schleife in public void done() ist...grausig ;). For Schleifen sind (u.a.) dazu da, sich wiederholenden Code zu vermeiden. Hier machst Du in der Schleife aber immer wieder das gleiche.

Besser wäre sowas, (Pseudocode, ungetestet):
PHP:
if(e==null){
    int i = 0; // i wird nur für die Log Meldung benötigt und kann eigentlich ganz weg.
    
    if(!parseObjectList.isEmpty()) {
        for (ParseObject highscore : parseObjectList) {
            Score score = new Score();
            score.setPlayer(highscore.getString("Player"));  
            score.setLevel(highscore.getString("LVL"));
            score.setPunkte(highscore.getString("Punkte"));  
            scores.add(score);
        
            i+=1; 
            Log.d("HighscoreActivity.done", "OK number " + i);
        }
        Log.d("HighscoreActicity.done", "For loop finished: " + parseObjectList.size() + " entries added");
    } else {
        Log.d("HighscoreActivity.done", "parseObjectList is empty!");
    }
} else {
    Log.d("HighscoreActivity.done", "ParseException: " + e.getMessage());
}
Das if(e == null) {...} else{...} hab ich so gelassen, ich kenn's eigentlich so, dass man Exceptions mit try/catch Blöcken behandelt, aber im Programming Guide von Parse.com steht's halt so drin.

Abgesehen davon, dass ich die Schleife aufgeräumt hab, (ich hoffe das läuft so, ich hab ja weder deinen Code noch das Parse.com Zeug), hab ich noch eine .isEmpty() Abfrage mit Debug Meldung eingebaut, um festzustellen, ob deine parseObjectList überhaupt Daten enthält.

Noch eine Kleinigkeit:
if(!(score.getBild()==null))
Das macht man eigentlich so: if(score.getBild()!=null)

Das wär's erstmal von mir.
 
Hi!

Erstmal vielen dank für die Tipps!

Also wenn die ViewList da ist enthält sich auch daten(also in meinem fall 3 mal den selben eintrag, durch deinen Verbesserungsvorschlag sind jetzt alle 6 vorhandenen einträge ín der Liste) aber wenn sie nicht da ist dann ist garnichts zu sehen auch keine leere ViewList!

Mit bibliothekLV.notifyDataSetChanged(); hab ich auch schon rum experimentiert finde aber keinen platz im script wo es so akzeptiert wird!

Hier die Logcat. Die ViewList wurde nicht angezeigt!

Code:
03-23 15:25:27.709    2019-2019/com.echessa.noteapp W/ActivityThread Application com.echessa.noteapp is waiting for the debugger on port 8100...
03-23 15:25:27.719    2019-2019/com.echessa.noteapp I/System.out Sending WAIT chunk
03-23 15:25:27.859    2019-2025/com.echessa.noteapp I/dalvikvm Debugger is active
03-23 15:25:27.929    2019-2019/com.echessa.noteapp I/System.out Debugger has connected
03-23 15:25:27.929    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:28.149    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:28.359    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:28.569    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:28.779    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:28.989    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:29.199    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:29.409    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:29.619    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:29.829    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:30.039    2019-2019/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:25:30.249    2019-2019/com.echessa.noteapp I/System.out debugger has settled (1308)
03-23 15:25:30.249    2019-2019/com.echessa.noteapp D/Quiz Start??? oder wann
03-23 15:25:30.309    2019-2019/com.echessa.noteapp I/dalvikvm Could not find method android.view.ViewGroup.onNestedScrollAccepted, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onNestedScrollAccepted
03-23 15:25:30.309    2019-2019/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 12338: Landroid/view/ViewGroup;.onNestedScrollAccepted (Landroid/view/View;Landroid/view/View;I)V
03-23 15:25:30.309    2019-2019/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6f at 0x0000
03-23 15:25:30.309    2019-2019/com.echessa.noteapp I/dalvikvm Could not find method android.view.ViewGroup.onStopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onStopNestedScroll
03-23 15:25:30.309    2019-2019/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 12344: Landroid/view/ViewGroup;.onStopNestedScroll (Landroid/view/View;)V
03-23 15:25:30.309    2019-2019/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6f at 0x0000
03-23 15:25:30.309    2019-2019/com.echessa.noteapp I/dalvikvm Could not find method android.support.v7.internal.widget.ActionBarOverlayLayout.stopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.setHideOnContentScrollEnabled
03-23 15:25:30.309    2019-2019/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 9901: Landroid/support/v7/internal/widget/ActionBarOverlayLayout;.stopNestedScroll ()V
03-23 15:25:30.309    2019-2019/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6e at 0x000e
03-23 15:25:30.319    2019-2019/com.echessa.noteapp I/dalvikvm Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
03-23 15:25:30.319    2019-2019/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 444: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
03-23 15:25:30.329    2019-2019/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6e at 0x0002
03-23 15:25:30.329    2019-2019/com.echessa.noteapp I/dalvikvm Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
03-23 15:25:30.329    2019-2019/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 466: Landroid/content/res/TypedArray;.getType (I)I
03-23 15:25:30.329    2019-2019/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6e at 0x0002
03-23 15:25:30.329    2019-2019/com.echessa.noteapp I/dalvikvm Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawable
03-23 15:25:30.329    2019-2019/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 407: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
03-23 15:25:30.329    2019-2019/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6e at 0x0002
03-23 15:25:30.329    2019-2019/com.echessa.noteapp I/dalvikvm Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawableForDensity
03-23 15:25:30.329    2019-2019/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 409: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
03-23 15:25:30.329    2019-2019/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6e at 0x0002
03-23 15:25:30.429    2019-2019/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 118K, 6% free 3273K/3468K, paused 2ms, total 22ms
03-23 15:25:30.439    2019-2019/com.echessa.noteapp I/dalvikvm-heap Grow heap (frag case) to 21.500MB for 19120080-byte allocation
03-23 15:25:30.469    2019-2028/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 3K, 1% free 21941K/22144K, paused 16ms, total 16ms
03-23 15:25:30.789    2019-2019/com.echessa.noteapp D/ HostConnection::get() New Host Connection established 0xb8097a70, tid 2019
03-23 15:25:30.819    2019-2019/com.echessa.noteapp W/EGL_emulation eglSurfaceAttrib not implemented
03-23 15:25:30.829    2019-2019/com.echessa.noteapp D/OpenGLRenderer Enabling debug mode 0
03-23 15:26:00.960    2019-2019/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 252K, 2% free 23717K/24044K, paused 7ms, total 8ms
03-23 15:26:01.000    2019-2019/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 9K, 2% free 25491K/25820K, paused 2ms, total 2ms
03-23 15:26:01.040    2019-2019/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 4K, 2% free 27271K/27596K, paused 3ms, total 3ms
03-23 15:26:01.070    2019-2019/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 4K, 2% free 29050K/29372K, paused 3ms, total 6ms
03-23 15:26:01.110    2019-2019/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 4K, 2% free 30460K/30780K, paused 3ms, total 3ms
03-23 15:26:01.110    2019-2019/com.echessa.noteapp I/dalvikvm-heap Grow heap (frag case) to 32.236MB for 2536932-byte allocation
03-23 15:26:01.120    2019-2028/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed <1K, 1% free 32937K/33260K, paused 3ms, total 3ms
03-23 15:26:01.230    2019-2019/com.echessa.noteapp W/EGL_emulation eglSurfaceAttrib not implemented
03-23 15:26:02.030    2019-2019/com.echessa.noteapp D/HighscoreActivity.done OK number 1
03-23 15:26:02.030    2019-2019/com.echessa.noteapp D/HighscoreActivity.done OK number 2
03-23 15:26:02.030    2019-2019/com.echessa.noteapp D/HighscoreActivity.done OK number 3
03-23 15:26:02.040    2019-2019/com.echessa.noteapp D/HighscoreActivity.done OK number 4
03-23 15:26:02.040    2019-2019/com.echessa.noteapp D/HighscoreActivity.done OK number 5
03-23 15:26:02.040    2019-2019/com.echessa.noteapp D/HighscoreActivity.done OK number 6
03-23 15:26:02.040    2019-2019/com.echessa.noteapp D/HighscoreActicity.done For loop finished: 6 entries added
Hier jetzt der logcat mit anzeige:

Code:
03-23 15:35:37.349    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:37.559    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:37.779    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:37.989    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:38.199    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:38.409    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:38.619    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:38.829    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:39.039    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:39.249    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:39.459    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:39.669    2120-2120/com.echessa.noteapp I/System.out waiting for debugger to settle...
03-23 15:35:39.879    2120-2120/com.echessa.noteapp I/System.out debugger has settled (1451)
03-23 15:35:39.879    2120-2120/com.echessa.noteapp D/Quiz Start??? oder wann
03-23 15:35:39.939    2120-2120/com.echessa.noteapp I/dalvikvm Could not find method android.view.ViewGroup.onNestedScrollAccepted, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onNestedScrollAccepted
03-23 15:35:39.939    2120-2120/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 12338: Landroid/view/ViewGroup;.onNestedScrollAccepted (Landroid/view/View;Landroid/view/View;I)V
03-23 15:35:39.939    2120-2120/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6f at 0x0000
03-23 15:35:39.939    2120-2120/com.echessa.noteapp I/dalvikvm Could not find method android.view.ViewGroup.onStopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onStopNestedScroll
03-23 15:35:39.939    2120-2120/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 12344: Landroid/view/ViewGroup;.onStopNestedScroll (Landroid/view/View;)V
03-23 15:35:39.939    2120-2120/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6f at 0x0000
03-23 15:35:39.939    2120-2120/com.echessa.noteapp I/dalvikvm Could not find method android.support.v7.internal.widget.ActionBarOverlayLayout.stopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.setHideOnContentScrollEnabled
03-23 15:35:39.939    2120-2120/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 9901: Landroid/support/v7/internal/widget/ActionBarOverlayLayout;.stopNestedScroll ()V
03-23 15:35:39.939    2120-2120/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6e at 0x000e
03-23 15:35:39.939    2120-2120/com.echessa.noteapp I/dalvikvm Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
03-23 15:35:39.939    2120-2120/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 444: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
03-23 15:35:39.939    2120-2120/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6e at 0x0002
03-23 15:35:39.939    2120-2120/com.echessa.noteapp I/dalvikvm Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
03-23 15:35:39.939    2120-2120/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 466: Landroid/content/res/TypedArray;.getType (I)I
03-23 15:35:39.939    2120-2120/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6e at 0x0002
03-23 15:35:39.939    2120-2120/com.echessa.noteapp I/dalvikvm Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawable
03-23 15:35:39.939    2120-2120/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 407: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
03-23 15:35:39.939    2120-2120/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6e at 0x0002
03-23 15:35:39.939    2120-2120/com.echessa.noteapp I/dalvikvm Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawableForDensity
03-23 15:35:39.939    2120-2120/com.echessa.noteapp W/dalvikvm VFY: unable to resolve virtual method 409: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
03-23 15:35:39.939    2120-2120/com.echessa.noteapp D/dalvikvm VFY: replacing opcode 0x6e at 0x0002
03-23 15:35:40.099    2120-2120/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 121K, 6% free 3273K/3472K, paused 3ms, total 12ms
03-23 15:35:40.169    2120-2120/com.echessa.noteapp I/dalvikvm-heap Grow heap (frag case) to 21.500MB for 19120080-byte allocation
03-23 15:35:40.189    2120-2129/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 3K, 1% free 21941K/22148K, paused 16ms, total 16ms
03-23 15:35:40.629    2120-2120/com.echessa.noteapp D/ HostConnection::get() New Host Connection established 0xb8088590, tid 2120
03-23 15:35:40.679    2120-2120/com.echessa.noteapp W/EGL_emulation eglSurfaceAttrib not implemented
03-23 15:35:40.689    2120-2120/com.echessa.noteapp D/OpenGLRenderer Enabling debug mode 0
03-23 15:35:57.759    2120-2120/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 248K, 2% free 23717K/24040K, paused 3ms, total 5ms
03-23 15:35:57.799    2120-2120/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 9K, 2% free 25491K/25816K, paused 3ms, total 3ms
03-23 15:35:57.829    2120-2120/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 4K, 2% free 27271K/27592K, paused 3ms, total 4ms
03-23 15:35:57.869    2120-2120/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 4K, 2% free 29050K/29368K, paused 3ms, total 5ms
03-23 15:35:57.909    2120-2120/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 4K, 2% free 30460K/30776K, paused 3ms, total 4ms
03-23 15:35:57.909    2120-2120/com.echessa.noteapp I/dalvikvm-heap Grow heap (frag case) to 32.236MB for 2536932-byte allocation
03-23 15:35:57.929    2120-2129/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed <1K, 1% free 32937K/33256K, paused 16ms, total 16ms
03-23 15:35:58.029    2120-2120/com.echessa.noteapp W/EGL_emulation eglSurfaceAttrib not implemented
03-23 15:36:00.029    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 1
03-23 15:36:00.029    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 2
03-23 15:36:00.029    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 3
03-23 15:36:00.029    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 4
03-23 15:36:00.029    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 5
03-23 15:36:00.029    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 6
03-23 15:36:00.029    2120-2120/com.echessa.noteapp D/HighscoreActicity.done For loop finished: 6 entries added
Wenn ich mit dem Back Button aus der Activity gehe und dann wieder in die Highscore Activity wechsel kommt immer der selbe inhalt in der logcat dazu, egal ob die Liste sichtbar wird oder nicht!

Code:
03-23 15:37:49.241    2120-2120/com.echessa.noteapp W/EGL_emulation eglSurfaceAttrib not implemented
03-23 15:38:13.591    2120-2120/com.echessa.noteapp W/EGL_emulation eglSurfaceAttrib not implemented
03-23 15:38:14.441    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 1
03-23 15:38:14.441    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 2
03-23 15:38:14.451    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 3
03-23 15:38:14.451    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 4
03-23 15:38:14.451    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 5
03-23 15:38:14.451    2120-2120/com.echessa.noteapp D/HighscoreActivity.done OK number 6
03-23 15:38:14.451    2120-2120/com.echessa.noteapp D/HighscoreActicity.done For loop finished: 6 entries added
 
Mhh, also das Logcat war ja mal wenig hilfreich. Die sehen wirklich völlig gleich aus.
Auf jeden Fall werden, egal ob die Listview da ist oder nicht, die Daten geladen. (Auch ohne .notifyDataSetChanged() anscheinend:confused2:).

Ich nehm mal an, dass das Logcat vom Emulator kommt, könntest Du noch eins vom Gerät machen?

Ansonsten könnte ich mir vorstellen, dass dein verschachteltes Layout dem Emulator Probleme macht. Ich hab das daher mal vereinfacht, sollte ähnlich aussehen, ohne die ganzen extra LinearLayouts. Guck doch mal, wie's dann aussieht.

PHP:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/frameLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ff75bcf0"
    android:gravity="center_horizontal"
    android:orientation="vertical"
    android:weightSum="1"
    tools:context=".MainActivity" >

    <ImageView
        android:id="@+id/highscore_anim_view"
        android:layout_width="280dp"
        android:layout_height="60dp"
        android:layout_gravity="center_horizontal"
        android:src="@drawable/highscore_title_anim" />

    <ListView
        android:id="@+id/listView1"
        android:layout_width="298dp"
        android:layout_height="315dp"
        android:scrollbars="vertical"
        android:visibility="visible" />

</LinearLayout>
 
Ja richtig, das logcat ist vom Emulator...leider läst sich mein HTC M8 nicht mit USB an meinen Rechner Verbinden (auch nerviges thema) und kann somit kein logcat vom Handy auslesen! Oder geht das auch irgendwie anders?

Das mit deinem einfachen Layout hat leider auch nichts gebracht! Hatte es auch schon probiert das Layout auf das nötigste zu beschränken aber das ergebniss ist immer noch genau das selbe!

Frustrierend! :unsure:
 
Das ist ja doof...
Also eine Möglichkeit wäre natürlich ein anderes Gerät aus deinem Umfeld oder Du installierst mal das hier und probierst ob Du damit an das Log kommst.

Ansonsten gehen mir aber langsam auch mir die Ideen aus. :(
Benutzt Du eigentlich Eclipse oder AndroidStudio (hat nix mit dem Fehler zu tun, interessiert mich nur).
 
hey falls du zu dem teil mit dem sortieren mal komsmt empfehle ich dir den natural merge sort zu benutzen der hat immer eine laufzeit von O(log(n))


jedoch beachte dass merge sort oft rekursiv angelegt wird und dadurch deine memory bei jedem rekursionsschritt wächst deswegen musst du abschätzen wie groß dein n wird


nur mal so nebenbei
 
@reallord aLogcat läuft leider nicht im hintergrund.... werd nachher mal schauen ob meiner Freundin ihr M8 sich an meinen PC anschliessen läst, befürchte aber eher das es nicht geht da es warscheinlich an Win8 liegt! Ansonsten beim nächsten besuch von nem Kumpel! Und ich benutze Android Studio!

@Jaiel Okay merk ich mir...
 
Hier klappt aber auch gar nix...

Option a) Da es anscheinend wirklich Probleme mit Windows 8 und HTC + ADB gibt, liegt es wohl nicht an deinem System. Du könntest versuchen, dass zu lösen. Falls Du langfristig Dich mit Android beschäftigen willst, wäre die Möglichkeit ein Gerät (Dein M8) richtig debuggen zu können extrem wichtig.
Hier hat ein User mit Win 8 und einem M7 bei sich das Problem lösen können, in dem die Einstellungen von Win 8 geändert und danach dann die richtige Treiberinstallation möglich war.

Option b) Du schickst mir die APK und ich lass die hier mal laufen. Setzt aber halt auf deiner Seite Vertrauen voraus. Insbesondere da ich nicht weiß, wofür deine App gedacht ist bzw. wie 'geheim' das Ganze bleiben soll. So kämen wir aber zumindest an ein Logcat.

Mehr fällt mir auch nicht ein, sofern Du nicht Zugriff auf andere Hardware (nicht HTC) oder vielleicht ein anderes Betriebssystem (7, Linux) hast.

Aber letztendlich kann es auch sein, dass uns das Logcat gar nix bringt und der Fehler irgendwo anders liegt.
 
So... war gestern bei nem Freund der Android Studio auf einem Win7 System hat und habe dort mal
das Logcat von meinem Handy ausgelesen. Befürchte aber das es auch nicht allzu aufschlussreicht ist.
Da das Logcat ja jetzt vorhanden ist brauchst du die apk ja nicht aber da meine App eigentlich
hauptsächlich zum Java kennen Lernen gedacht ist habe ich auch kein problehm damit das ganze Projekt zu Verlinken, fals das gewüscht und hilfreich ist...

Hier mal das Logcat:

Code:
03-25 18:52:57.009  13037-13037/com.echessa.noteapp I/art Late-enabling -Xcheck:jni
03-25 18:52:57.009  13037-13037/com.echessa.noteapp I/art VMHOOK: rlim_cur : 0 pid:13037
03-25 18:52:57.049  13037-13037/com.echessa.noteapp D/Quiz Start??? oder wann
03-25 18:52:57.359  13037-13037/com.echessa.noteapp D/Atlas Validating map...
03-25 18:52:57.399  13037-13037/com.echessa.noteapp I/ToolbarWidgetWrapper Progress display unsupported
03-25 18:52:57.509  13037-13063/com.echessa.noteapp I/Adreno-EGL <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1_RB1.05.00.00.002.030_msm8974_refs/tags/AU_LINUX_ANDROID_LA.BF.1.1_RB1.05.00.00.002.030__release_AU ()
    OpenGL ES Shader Compiler Version: E031.25.03.00
    Build Date: 12/11/14 Thu
    Local Branch:
    Remote Branch: refs/tags/AU_LINUX_ANDROID_LA.BF.1.1_RB1.05.00.00.002.030
    Local Patches: NONE
    Reconstruct Branch: NOTHING
03-25 18:52:57.699  13037-13037/com.echessa.noteapp I/InputMethodManager [startInputInner] EditorInfo { packageName=com.echessa.noteapp, inputType=0x20001, imeOptions=0x48000005, privateImeOptions=null }, windowGainingFocus=android.view.ViewRootImpl$W@1a07fbe8, mServedView=android.widget.EditText{1972201 VFED..CL .F....I. 48,580-1032,704 #7f08003f app:id/usernameField}, mServedInputConnectionWrapper=android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper@77bf8a6
03-25 18:53:08.359  13037-13037/com.echessa.noteapp I/InputMethodManager [startInputInner] EditorInfo { packageName=com.echessa.noteapp, inputType=0x81, imeOptions=0x4001006, privateImeOptions=null }, windowGainingFocus=null, mServedView=android.widget.EditText{c262f18 VFED..CL .F.P..ID 48,704-1032,828 #7f080040 app:id/passwordField}, mServedInputConnectionWrapper=android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper@132b8d71
03-25 18:53:13.429  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfofornet+,hn 13(0x6170692e706172),sn(),hints(known),family 0,flags 4
03-25 18:53:13.429  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfofornet-, err=8
03-25 18:53:13.429  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfofornet+,hn 13(0x6170692e706172),sn(),hints(known),family 0,flags 1024
03-25 18:53:13.429  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfofornet-, pass to proxy
03-25 18:53:13.429  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfo_proxy+
03-25 18:53:13.429  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfo_proxy get netid:0
03-25 18:53:13.609  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfo_proxy-, success
03-25 18:53:13.609  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfofornet+,hn 14(0x35342e3233362e),sn(),hints(known),family 0,flags 4
03-25 18:53:13.609  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfofornet-, SUCCESS
03-25 18:53:14.309  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfofornet+,hn 13(0x6170692e706172),sn(),hints(known),family 0,flags 4
03-25 18:53:14.309  13037-13446/com.echessa.noteapp D/libc [NET] android_getaddrinfofornet-, err=8
03-25 18:53:18.169  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 1
03-25 18:53:18.169  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 2
03-25 18:53:18.169  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 3
03-25 18:53:18.169  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 4
03-25 18:53:18.169  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 5
03-25 18:53:18.169  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 6
03-25 18:53:18.169  13037-13037/com.echessa.noteapp D/HighscoreActicity.done For loop finished: 6 entries added
03-25 18:53:25.509  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 1
03-25 18:53:25.509  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 2
03-25 18:53:25.509  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 3
03-25 18:53:25.509  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 4
03-25 18:53:25.509  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 5
03-25 18:53:25.509  13037-13037/com.echessa.noteapp D/HighscoreActivity.done OK number 6
03-25 18:53:25.509  13037-13037/com.echessa.noteapp D/HighscoreActicity.done For loop finished: 6 entries added
 
Hmm, der einzige Unterschied den ich sehe, ist das hier:

PHP:
03-25 18:52:57.359  13037-13037/com.echessa.noteapp D/Atlas? Validating map...
03-25 18:52:57.399  13037-13037/com.echessa.noteapp I/ToolbarWidgetWrapper? Progress display unsupported

Laut Google Suche tauchen beide Meldungen in Zusammenhang mit Android 5 auf.
Hast Du Lollipop auf deinem M8? Und welches API Level hat deine App?

Habt ihr mal deine App auf seinem Gerät laufen lassen? Nicht dass das hier ein HTC spezifisches Problem ist.
 
Auf meinem M8 ist Android 5.01 drauf. Die App hat nimSdk 14 und TargetSdk 19. CompileSdkVersion 22.

Hab jetzt mal ne fehlermeldung aus einem Logcat bekommen! Trat irgendwann auf nachdem ich immerwieder aus der Highscore Activity raus und wieder rein bin.

Code:
03-28 16:02:57.605    1760-1760/com.echessa.noteapp E/HardwareRenderer An error has occurred while drawing:
    java.lang.IllegalStateException: The display list is not valid.
            at android.view.GLES20DisplayList.getNativeDisplayList(GLES20DisplayList.java:49)
            at android.view.GLES20Canvas.drawDisplayList(GLES20Canvas.java:420)
            at android.view.HardwareRenderer$GlRenderer.drawDisplayList(HardwareRenderer.java:1646)
            at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1469)
            at android.view.ViewRootImpl.draw(ViewRootImpl.java:2381)
            at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
            at android.view.Choreographer.doCallbacks(Choreographer.java:574)
            at android.view.Choreographer.doFrame(Choreographer.java:544)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)
03-28 16:03:01.285    1760-1765/com.echessa.noteapp D/dalvikvm GC_FOR_ALLOC freed 1176K, 4% free 33810K/35060K, paused 5ms, total 13ms
 
Okaayyy, die Meldung ist mir noch nie untergekommen.

Ich hab dazu nur einen Hinweis gefunden, setz doch mal bitte in deine AndroidManifest.xml Datei an entsprechender Stelle:
PHP:
<application 
              android:hardwareAccelerated="false" 
              ...>
Im Android Dev Guide steht u.a.:
However, because hardware acceleration is not supported for all of the 2D drawing operations, turning it on might affect some of your custom views or drawing calls. Problems usually manifest themselves as invisible elements, exceptions, or wrongly rendered pixels.
Ehrlich gesagt, weiß ich nicht, ob das was bringt. Aber sonst fällt mir nix dazu ein.
 
Also im Emutaltor hat es was gebracht! Bei ca. 30 versuchen war die ViewList bis auf ein einziges mal immer sichtbar, allerdings nur im Emulator! Ein HTC M8 Spezifisches problem schliese ich allerdings aus. Hab die App noch bei freunden auf anderen Handys ausprobiert (Samsung,Sony und Kazam) aber auch da war nichts zu sehen von der ViewList! Werde wohl am besten die ganze Highscore Activity nochmal von vorn aufbauen...:sad:
 
Mhh, das wirklich einzige, dass mir noch einfällt ist, dass Du mal die CompileSDK Version auch auf 19 setzt. (Die ist üblicherweise eh immer identisch zur TargetSDK)

Ansonsten müsstest Du halt das ganze Projekt online/zur Verfügung stellen, damit man sich dass dann mal direkt ansehen kann...

Oder Du fängst halt, wie Du geschrieben hast, von vorne an. Dann besteht aber natürlich die Gefahr, dass Du wieder in das gleiche Problem läufst. :(
 
Sooo, das hat jetzt ein wenig länger gedauert...Ich hab erst versucht dein Projekt in Eclipse zu bekommen, das war nix...

Mit frisch installiertem Android Studio, einigen Updates und ein bisschen Warten, lief die App dann, aber die Liste war bei mir (wie zu erwarten) auch leer.

Sooweit ich das jetzt sagen kann, liegt das Problem daran, dass dass ganze Parse/findInBackground Zeug noch gar nicht fertig ist, wenn Android deinen Adapter initialisiert.
In dem Moment sind keine! Einträge vorhanden, ergo bleibt die Liste auch leer bzw. wird nicht angezeigt.

Also hab ich jetzt im public void done an passender Stelle das notifyDataSetChanged() eingebaut.

Ich poste jetzt nur die HighscoreActivity, sonst hab ich nix geändert und selbst da eigentlich nur 3 Sachen.

PHP:
...
public class HighscoreActivity extends Activity {

    // declare score adapter
    ScoreAdapter adapter;

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

        ImageView HS_anim = (ImageView)findViewById(R.id.highscore_anim_view);
        final AnimationDrawable HighscoreAnimationDrawable
                = (AnimationDrawable)HS_anim.getDrawable();

        HS_anim.post(
                new Runnable(){

                   @Override
                   public void run() {
                       HighscoreAnimationDrawable.start();
                    }
                });

        final List<Score> scores = new ArrayList<Score>(0);

        ParseQuery<ParseObject> query = ParseQuery.getQuery("Highscore");
        query.findInBackground(new FindCallback<ParseObject>() {
            public void done(List<ParseObject> parseObjectList, ParseException e) {
                if(e==null){
                    int i = 0; // i wird nur für die Log Meldung benötigt und kann eigentlich ganz weg.

                    if(!parseObjectList.isEmpty()) {
                        for (ParseObject highscore : parseObjectList) {
                            Score score = new Score();
                            score.setPlayer(highscore.getString("Player"));
                            score.setLevel(highscore.getString("LVL"));
                            //score.setPunkte(highscore.getInt("Punkte"));
                            scores.add(score);

                            i+=1;
                            Log.d("HighscoreActivity.done", "OK number " + i);
                        }
                        // notify adapter of new entries
                        if(adapter != null ){
                            adapter.notifyDataSetChanged();
                        }
                        Log.d("HighscoreActicity.done", "For loop finished: " + parseObjectList.size() + " entries added");

                    } else {
                        Log.d("HighscoreActivity.done", "parseObjectList is empty!");
                    }
                } else {
                    Log.d("HighscoreActivity.done", "ParseException: " + e.getMessage());
                }
            }
        });

        final ListView HS_ListView = (ListView) findViewById(R.id.list);
        adapter = new ScoreAdapter(this.getApplicationContext(), R.layout.listviewadapter, scores);
        HS_ListView.setAdapter(adapter);
    }
Läuft jetzt bei mir so auf nem Samsung Tab und nen Sony Smartphone (Beide Android 4.4). In der Liste sind aber zig Einträge mehrfach vorhanden.
Das ist entweder ein Bug oder deine Serverliste sieht momentan halt so aus.
 
  • Danke
Reaktionen: Massym
:thumbsup: Geht! :thumbsup:

Wow, bin besgeister! a: von dem aufwand den du dir gemacht hast um zu helfen!
Und b: das du es hinbekommen hast! Super Cool! Vielen Dank! Jetzt müsste ich nur noch den Danke Button hier im Forum finden dann bin ich erstmal restlos Glücklich....

Aso, nee ist kein bug die Serverliste sieht momentan so aus....
 
Zuletzt bearbeitet:
Massym schrieb:
Jetzt müsste ich nur noch den Danke Button hier im Forum finden dann bin ich erstmal restlos Glücklich....

Der sollte links neben dem "zitieren"-Button zu sehen sein ??
Bist evtl. mit irgendeinem Ad-Blocker unterwegs, der den ausblendet ? ;)
 
Nee kein Ad-Blocker! Hab gelesen das der Danke Button erst nach einer bestimmten menge beiträgen freigeschalltet wird! :winki: Hmm Schade, muss ich nicht verstehen warum das hier so ist...

Der ursprüngliche Beitrag von 17:34 Uhr wurde um 17:40 Uhr ergänzt:

Wohl ab dem 10ten Beitrag denn jetzt ist er da!
 

Ähnliche Themen

A
Antworten
10
Aufrufe
1.021
swa00
swa00
D
  • Data2006
Antworten
14
Aufrufe
487
jogimuc
J
D
  • Data2006
3 4 5
Antworten
84
Aufrufe
3.706
jogimuc
J
Zurück
Oben Unten