Soru & Cevap

cannot resolve symbol moveToNext

12.04.2016 - 06:40

Bu hatayı alıyorum. Neden olabilir acaba?

64 Görüntülenme

2 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

Profile picture for user paracetamooll
paracetamooll
12.04.2016 - 09:02
package com.example.selim.kpss2;

import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.AppIndex;
import com.google.android.gms.common.api.GoogleApiClient;


public class Tarihekrani extends Activity {

    TextView tv1;
    Button btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn10;

    /**
     * ATTENTION: This was auto-generated to implement the App Indexing API.
     * See https://g.co/AppIndexing/AndroidStudio for more information.
     */
    private GoogleApiClient client;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tarih_ekrani);

        tv1 = (TextView) findViewById(R.id.textView);
        btn3 = (Button) findViewById(R.id.button3);
        btn4 = (Button) findViewById(R.id.button4);
        btn5 = (Button) findViewById(R.id.button5);
        btn6 = (Button) findViewById(R.id.button6);
        btn7 = (Button) findViewById(R.id.button7);
        btn8 = (Button) findViewById(R.id.button8);
        btn9 = (Button) findViewById(R.id.button9);
        btn10 = (Button) findViewById(R.id.button10);

        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btn4.getBackground().clearColorFilter();
                btn5.getBackground().clearColorFilter();
                btn6.getBackground().clearColorFilter();
                btn7.getBackground().clearColorFilter();
                btn3.getBackground().setColorFilter(0xFFFF0000, PorterDuff.Mode.MULTIPLY);
                Toast.makeText(Tarihekrani.this, "A Şıkkını İşaretlediniz!", Toast.LENGTH_SHORT).show();
            }
        });
        btn4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btn3.getBackground().clearColorFilter();
                btn5.getBackground().clearColorFilter();
                btn6.getBackground().clearColorFilter();
                btn7.getBackground().clearColorFilter();
                btn4.getBackground().setColorFilter(0xFFFF0000, PorterDuff.Mode.MULTIPLY);
                Toast.makeText(Tarihekrani.this, "B Şıkkını İşaretlediniz!", Toast.LENGTH_SHORT).show();
            }
        });
        btn5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btn3.getBackground().clearColorFilter();
                btn4.getBackground().clearColorFilter();
                btn6.getBackground().clearColorFilter();
                btn7.getBackground().clearColorFilter();
                btn5.getBackground().setColorFilter(0xFFFF0000, PorterDuff.Mode.MULTIPLY);
                Toast.makeText(Tarihekrani.this, "C Şıkkını İşaretlediniz!", Toast.LENGTH_SHORT).show();
            }
        });
        btn6.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btn3.getBackground().clearColorFilter();
                btn4.getBackground().clearColorFilter();
                btn5.getBackground().clearColorFilter();
                btn7.getBackground().clearColorFilter();
                btn6.getBackground().setColorFilter(0xFFFF0000, PorterDuff.Mode.MULTIPLY);
                Toast.makeText(Tarihekrani.this, "D Şıkkını İşaretlediniz!", Toast.LENGTH_SHORT).show();
            }
        });
        btn7.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btn3.getBackground().clearColorFilter();
                btn4.getBackground().clearColorFilter();
                btn5.getBackground().clearColorFilter();
                btn6.getBackground().clearColorFilter();
                btn7.getBackground().setColorFilter(0xFFFF0000, PorterDuff.Mode.MULTIPLY);
                Toast.makeText(Tarihekrani.this, "E Şıkkını İşaretlediniz!", Toast.LENGTH_SHORT).show();
            }

        });



        btn9.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btn3.getBackground().clearColorFilter();
                btn4.getBackground().clearColorFilter();
                btn5.getBackground().clearColorFilter();
                btn6.getBackground().clearColorFilter();
                btn7.getBackground().clearColorFilter();
                btn3.setText("bilmiyom ki");
                btn4.setText("Bende bilmiyom");
                btn5.setText("Ben hiç bilmiyom:)");
                btn6.setText("Bi yerden bulacaz artık :)");
                btn7.setText("SQlite databasesten çekmeliyiz ama nasıl?:)");
                btn10.setText("SQlite databasesten çekmeliyiz ama nasıl?:)");
            }

        });
        btn8.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(btn10.getText() == btn3.getText()) {
                    btn3.getBackground().setColorFilter(0xFF00FF00, PorterDuff.Mode.MULTIPLY);
                }
                else if (btn10.getText() == btn4.getText()){
                    btn4.getBackground().setColorFilter(0xFF00FF00, PorterDuff.Mode.MULTIPLY);
                }
                else if (btn10.getText() == btn5.getText()){
                    btn5.getBackground().setColorFilter(0xFF00FF00, PorterDuff.Mode.MULTIPLY);
                }
                else if (btn10.getText() == btn6.getText()){
                    btn6.getBackground().setColorFilter(0xFF00FF00, PorterDuff.Mode.MULTIPLY);
                }
                else if (btn10.getText() == btn7.getText()){
                    btn7.getBackground().setColorFilter(0xFF00FF00, PorterDuff.Mode.MULTIPLY);
                }
            }

        });







        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.
        client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
    }


    @Override
    public void onStart() {
        super.onStart();

        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.
        client.connect();
        Action viewAction = Action.newAction(
                Action.TYPE_VIEW, // TODO: choose an action type.
                "Tarihekrani Page", // TODO: Define a title for the content shown.
                // TODO: If you have web page content that matches this app activity's content,
                // make sure this auto-generated web page URL is correct.
                // Otherwise, set the URL to null.
                Uri.parse("http://host/path"),
                // TODO: Make sure this auto-generated app deep link URI is correct.
                Uri.parse("android-app://com.example.selim.kpss2/http/host/path")
        );
        AppIndex.AppIndexApi.start(client, viewAction);
    }

    @Override
    public void onStop() {
        super.onStop();

        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.
        Action viewAction = Action.newAction(
                Action.TYPE_VIEW, // TODO: choose an action type.
                "Tarihekrani Page", // TODO: Define a title for the content shown.
                // TODO: If you have web page content that matches this app activity's content,
                // make sure this auto-generated web page URL is correct.
                // Otherwise, set the URL to null.
                Uri.parse("http://host/path"),
                // TODO: Make sure this auto-generated app deep link URI is correct.
                Uri.parse("android-app://com.example.selim.kpss2/http/host/path")
        );
        AppIndex.AppIndexApi.end(client, viewAction);
        client.disconnect();
    }

    SQLiteDatabase dtb=openOrCreateDatabase("kpsssorular.db", Context.MODE_PRIVATE,null);
    Cursor cursor = dtb.rawQuery("SELECT * FROM SORUTABLOSU LIMIT 1 OFFSET 3", null);
    while(cursor.moveToNext()){
        String soru = cursor.getString(2);

    }

}

 

Profile picture for user azatgoktas
azatgoktas
12.04.2016 - 08:24

Kodları daha detaylı yollar mısın?