package me.yoqi.android.jkbd.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import me.yoqi.android.jkbd.R;


public class MainActivity extends AppCompatActivity {

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

    @Override
    public void onBackPressed() {
        Intent intent=new Intent();
        setResult(RESULT_OK, intent);
        finish();
    }

    public void test(View view) {
//        OkHttpUtils<Exam> utils=new OkHttpUtils<>(this);
//        String uri="http://101.251.196.90:8080/JztkServer/examInfo";
//        utils.url(uri)
//                .targetClass(Exam.class)
//                .execute(new OkHttpUtils.OnCompleteListener<Exam>(){
//
//                    @Override
//                    public void onSuccess(Exam exam) {
//
//                        Log.e("main","result="+exam);
//                        Intent intent=new Intent(MainActivity.this,RandomTest.class);
//
//                        Bundle bundle = new Bundle();
//                        bundle.putSerializable("exam",exam);
//                        intent.putExtras(bundle);
//                        startActivity(intent);
//                    }
//
//                    @Override
//                    public void onError(String error) {
//                        Log.e("main","error="+error);
//                    }
//                });

        Intent intent=new Intent(MainActivity.this,RandomTest.class);
        startActivity(intent);

    }

    public void test_all(View view) {

    }

    public void setting(View view) {

    }

    public void quit(View view) {
        Intent intent=new Intent();
        setResult(RESULT_OK, intent);
        finish();
    }
}
