java - 尝试使用 SqliteDatabase

标签 java android sql sqlite

我有 editText1、editText2 和 EditText3 .用户需要在此区域写入个人信息。当他们按下保存按钮时, editText1、editText2 和 EditText3 必须保存。他们应该在他们想要的时候找到他们写的东西。但是当我尝试保存 其中 3 个(editText1、editText2 和 EditText3) ,这不会发生。 我可以只保存editText1 .或者我可以在 editText1 中保存 3 个空格区域。例如,我在editText1“你好”,在editText2“听”,在editText3“伙计们”中写道,我正在保存这个,当我在保存区域打开时,我可以看到3次“听”。其他不保存。 你能帮助我吗?我应该改变什么?

主要 Activity :

public class MainActivity extends AppCompatActivity {

    static ArrayList<Bitmap> newImage;


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {

        MenuInflater menuInflater = getMenuInflater();
        menuInflater.inflate(R.menu.add_new, menu);

        return super.onCreateOptionsMenu(menu);
    }

    @Override //Menüyü seçersek ne olacak onu belirler.
    public boolean onOptionsItemSelected(MenuItem item) {

        if (item.getItemId() == R.id.add_new) {

            Intent intent = new Intent(getApplicationContext(), Main2Activity.class);
            intent.putExtra("info", "new"); //Bu satırda amaç eğer yeni bir resimmi yoksa eski resimmi görentülenmek isteniyor onu anlamak
            startActivity(intent);
        }

        return super.onOptionsItemSelected(item);
    }

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

        ListView listView = (ListView) findViewById(R.id.listView);

        //Databaseden çektiğimiz dataları kaydedeceğimiz bir arraylist oluşturalım ve listview ile bağlayalım
        final ArrayList<String> newName = new ArrayList<String>();
        final ArrayList<String> newName2 = new ArrayList<String>();
        final ArrayList<String> newName3 = new ArrayList<String>();
        newImage = new ArrayList<Bitmap>();

        ArrayAdapter arrayAdapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1,newName);
        listView.setAdapter(arrayAdapter);

        //uygulama ilk açıldığında database'de kayıtlı bir şey varmı bakmasını istiyoruz aşağıdaki aşamalarda

        try {

            Main2Activity.database = this.openOrCreateDatabase("Yeni", MODE_PRIVATE, null);
            Main2Activity.database.execSQL("CREATE TABLE IF NOT EXISTS yeni (name VARCHAR, name2 VARCHAR, name3 VARCHAR, image BLOB)");

            Cursor cursor = Main2Activity.database.rawQuery("SELECT * FROM yeni", null); //Data çekmek için cursoru kullanıyoruz

            int nameIx = cursor.getColumnIndex("name");
            int name2Ix = cursor.getColumnIndex("name2");
            int name3Ix = cursor.getColumnIndex("name3");
            int imageIx = cursor.getColumnIndex("image");

            cursor.moveToFirst();

            while (cursor != null) {

                newName.add(cursor.getString(nameIx)); //Kullanıcının girdği ismi newName'in içine ekle
                newName2.add(cursor.getString(name2Ix));
                newName3.add(cursor.getString(name3Ix));

                byte[] byteArray = cursor.getBlob((imageIx));
                Bitmap image = BitmapFactory.decodeByteArray(byteArray,0,byteArray.length);
                newImage.add(image); //newImage'in içine ekle diyoruz

                cursor.moveToNext();

                arrayAdapter.notifyDataSetChanged();//Eğer bir datayı değiştirdiysek hemen güncelleyen bir konut
            }

        } catch (Exception e) {

        }

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

                Intent intent = new Intent (getApplicationContext(), Main2Activity.class);
                intent.putExtra("info", "old");
                intent.putExtra("name", newName.get(position));
                intent.putExtra("name2", newName2.get(position));
                intent.putExtra("name3", newName3.get(position));
                intent.putExtra("position", position);

                startActivity(intent);

            }
        });
    }

}

Main2Activity
public class Main2Activity extends AppCompatActivity {

    ImageView imageView; //imageView'i heryerde tanımladık
    EditText editText;
    EditText editText2;
    EditText editText3;

    static SQLiteDatabase database; //Buraya yazdığımız database'e MainActivity'den de ulaşabileceğiz çünkü statik yazdık
    Bitmap selectedImage; //seçilen resmi kaydetmek için burada bunu tanımladık

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

        imageView = (ImageView) findViewById(R.id.imageView); //layouttaki imageView'i tanımladık
        editText = (EditText) findViewById(R.id.editText);
        editText2 = (EditText) findViewById(R.id.editText2);
        editText3 = (EditText) findViewById(R.id.editText3);
        Button button = (Button) findViewById(R.id.button); //Buton tanımladık

        Intent intent = getIntent();

        String info = intent.getStringExtra("info"); //MainActivity'deki 28. satırla bağlantılı

        if (info.equalsIgnoreCase("new")) {

            Bitmap background = BitmapFactory.decodeResource(getApplicationContext().getResources(), R.drawable.dede); //Kullanıcı resim seçerkenki aşama

            imageView.setImageBitmap(background);

            button.setVisibility(View.VISIBLE); //Eğer yeni eklenecekse görünür yap
            editText.setText(""); //Bu satır eğer daha önceden bir şey yazdıysak onun orada kalmamasını bize boş yazma yeri açmasını sağlıyor
            editText2.setText("");
            editText3.setText("");

        } else {

            String name = intent.getStringExtra("name");
            editText.setText(name);
            String name2 = intent.getStringExtra("name2");
            editText2.setText(name2);
            String name3 = intent.getStringExtra("name3");
            editText3.setText(name3);
            int position = intent.getIntExtra("position", 0);

            imageView.setImageBitmap(MainActivity.newImage.get(position));

            button.setVisibility(View.INVISIBLE); //Eskiyse gösterme

        }
    }
    //Resim koyma yerine tıklandığında olacaklar
    public void select (View view) {

        if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {

            requestPermissions(new String[] {Manifest.permission.READ_EXTERNAL_STORAGE}, 2);
        } else {
            Intent intent = new Intent (Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); //Kullanıcının medyasına eriş diyoruz
            startActivityForResult(intent,1);
        }
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {

        if (requestCode == 2) {

            if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                Intent intent = new Intent (Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); //Kullanıcının medyasına eriş diyoruz
                startActivityForResult(intent,1);
            }
        }
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }

    //Yukarıdaki medyaya erişime izin verildiyse resim seçme yeri
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        if (requestCode == 1 && resultCode == RESULT_OK && data!= null) {

            Uri image = data.getData();
            //try ve catch ın içine aldık bu olayı çünkü bi sorun çıkarsa burda uygulama hata vermesin.
            try {
                selectedImage = MediaStore.Images.Media.getBitmap(this.getContentResolver(), image);
                imageView.setImageBitmap(selectedImage); //imageView'e burda ulaşmak için koyduk
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        super.onActivityResult(requestCode, resultCode, data);
    }

    // Kaydetme butonuna tıklandığında olacaklar
    public void save (View view) {

        String newName = editText.getText().toString(); //Kullanıcının kardettiği isme bu şekilde ulaştık
        String newName2 = editText2.getText().toString();
        String newName3 = editText3.getText().toString();
        //image'ler bytearray şeklinde kaydedilir!!!!!!!!!!

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); //selectedImage'i compress etmeliyiz kaydetme aşamalarından biri
        selectedImage.compress(Bitmap.CompressFormat.PNG,50,outputStream); //bu şekilde ziplemiş olduk resmi
        byte[] byteArray = outputStream.toByteArray(); //Bu outpuSteam'i al array'e çevir dedik! ve resmimiz kaydedilebilir oldu

        try { //Tüm bu alttaki aşamalarda kullanıcının girdiği isim ve resmi database'imize işlemiş olduk!
            database = this.openOrCreateDatabase("Yeni", MODE_PRIVATE, null);
            database.execSQL("CREATE TABLE IF NOT EXISTS yeni (name VARCHAR, image BLOB)");

            String sqlString = "INSERT INTO yeni (name, image) VALUES (?, ?, ?, ?)";
            SQLiteStatement statement =database.compileStatement(sqlString);
            statement.bindString(1,newName);
            statement.bindString(3,newName2);
            statement.bindString(4,newName3);
            statement.bindBlob(2,byteArray);
            statement.execute();

        } catch (Exception e) {
            e.printStackTrace();
        }

        Intent intent = new Intent(getApplicationContext(), MainActivity.class); //kaydet'e bastığında anasayfaya yönlendirilsin
        startActivity(intent);





    }
}

最佳答案

问题 1 是您尝试定义同一个表,但有 4 列(在 onCreateMainActivity 方法中),然后使用 2 列(在 saveMain2Activity 方法中),第二个不会将表创建为它已经被创建了,所以看起来 4 列版本将存在(如果它不存在并且表被创建,那么每当您返回 MainActivity 作为两列(name2name3 ) 将不存在并导致在尝试 int name2Ix = cursor.getColumnIndex("name2"); 时找不到列。

一个 第二期是您尝试插入 2 个值,但将 4 个值作为参数给出,即 INSERT INTO yeni (name,image) .... 2 个值 VALUES(?, ?, ? ,?) 4个论据。

一个 第三期是您没有检测到插入的成功或失败,而只是假设它会起作用(当它不起作用时)。在 SQLiteDatabase 方法周围使用 try/catch 也不是一个好主意,因为它们通常会处理许多情况,并且只会在出现严重错误时崩溃(并且您想要崩溃)。

一个 第四期是您可以单击保存按钮(假设您在布局中使用了android:onClick="save"),selectedImage很可能是空的。

一个 第五期是用 Main2Activity 完成后你尝试开始MainActivity ,这将开始另一个 Activity ,而不是您通过完成 Main2Activity 返回它.目前,这对您有利,因为 ListView 列出了新插入的行。但是,您最终会获得大量 Activity ,并且点击后退按钮将逐步返回 Activity 堆栈,并且会非常困惑。

修复第5个问题,即完成Main2Activty介绍了 第6期那就是 List 没有刷新,它保持在插入新行之前的状态。

修复第 6 个问题需要更改许多代码,但最终您通过覆盖 onResume 来刷新列表通过重建 List 的源(清除 ArrayList 然后将所有元素添加到其中)的方法。

第 4 期的临时修复。

忽略第一个问题,这不会导致问题,因为看起来首先创建了具有 4 列的表(当然是在测试中)。
并且最初也忽略了第 2 和第 3 期。但是使用:-

    if (info.equalsIgnoreCase("new")) { // UNCHANGED

        Bitmap background = BitmapFactory.decodeResource(
                getApplicationContext().getResources(), 
                android.R.drawable.ic_dialog_alert //<<<< Use a stock Android image for testing
        ); //Kullanıcı resim seçerkenki aşama
        selectedImage = background; //<<<< ADDED to overcome null pointer exception
        imageView.setImageBitmap(background); //<<<< UNCHANGED
        //........ rest of the code

Main2ActivityonCreate方法和输入在 3 个 EditText 中的测试、测试和测试,然后单击按钮会导致返回到 MainActivity 但没有显示任何内容。但是,日志显示预期的 E/SQLiteLog: (1) 4 values for 2 columns :-
06-03 22:13:09.895 2647-2647/yeni.yeni E/SQLiteLog: (1) 4 values for 2 columns
06-03 22:13:09.895 2647-2647/yeni.yeni W/System.err: android.database.sqlite.SQLiteException: 4 values for 2 columns (code 1): , while compiling: INSERT INTO yeni (name, image) VALUES (?, ?, ?, ?)
        at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
        at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:887)
        at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:498)
        at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
        at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
        at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
        at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:994)
        at yeni.yeni.Main2Activity.save(Main2Activity.java:145)
        at java.lang.reflect.Method.invoke(Native Method)
        at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384)
        at android.view.View.performClick(View.java:5198)
        at android.view.View$PerformClick.run(View.java:21147)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

第 2 和第 3 个问题的主要修复

针对主要问题(插入未插入记录)的建议修复方法可能如下,它利用 SQLiteDatabase insert convenience method :-
public void save (View view) {

    String newName = editText.getText().toString(); //Kullanıcının kardettiği isme bu şekilde ulaştık
    String newName2 = editText2.getText().toString();
    String newName3 = editText3.getText().toString();
    //image'ler bytearray şeklinde kaydedilir!!!!!!!!!!

    ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); //selectedImage'i compress etmeliyiz kaydetme aşamalarından biri
    selectedImage.compress(Bitmap.CompressFormat.PNG,50,outputStream); //bu şekilde ziplemiş olduk resmi
    byte[] byteArray = outputStream.toByteArray(); //Bu outpuSteam'i al array'e çevir dedik! ve resmimiz kaydedilebilir oldu

    ContentValues cv = new ContentValues();
    cv.put("name",newName);
    cv.put("name2",newName2);
    cv.put("name3",newName3);
    cv.put("image",byteArray);
    long new_row_id = database.insert("yeni",null,cv);
    //<<<< ADDED TO ISSUE TOAST WITH THE RESULT
    if (new_row_id > 0) {
        Toast.makeText(this,"Row Insereted.",Toast.LENGTH_SHORT).show();
    } else {
        Toast.makeText(this,"Row NOT Inserted",Toast.LENGTH_SHORT).show();
    }
    /*
    try { //Tüm bu alttaki aşamalarda kullanıcının girdiği isim ve resmi database'imize işlemiş olduk!
        Log.d("SAVE","Attempting OPEN Or CREATE DATABASE");
        database = this.openOrCreateDatabase("Yeni", MODE_PRIVATE, null);
        Log.d("SAVE","Attempting CREATE OF TABLE yeni");
        database.execSQL("CREATE TABLE IF NOT EXISTS yeni (name VARCHAR, image BLOB)");

        String sqlString = "INSERT INTO yeni (name, image) VALUES (?, ?, ?, ?)";
        SQLiteStatement statement =database.compileStatement(sqlString);
        statement.bindString(1,newName);
        statement.bindString(3,newName2);
        statement.bindString(4,newName3);
        statement.bindBlob(2,byteArray);
        Log.d("SAVE","Attempting EXECUTION of the SQL INSERT using :- " + statement.toString());
        statement.execute();

    } catch (Exception e) {
        e.printStackTrace();
    }
    */
    Intent intent = new Intent(getApplicationContext(), MainActivity.class); //kaydet'e bastığında anasayfaya yönlendirilsin
    startActivity(intent);

    //this.finish(); //<<<< Should not start a parent activity you should return to it by finishing the child activity
}

修复第 6 个问题(需要在修复第 5 个问题之前)

这需要进行大量代码更改,但基本上涉及允许通过 onResume 刷新列表 中的方法MainActivity
public class MainActivity extends AppCompatActivity {

    static ArrayList<Bitmap> newImage;
    ArrayList<String> nameList;
    ArrayList<String> name2List;
    ArrayList<String> name3List;
    ArrayAdapter<String> arrayadpater;
    ListView listView;

    Button addbutton; //<<<< Instead of menu for my convenience
    //<<<<<<<<<< Code Commented out for convenience of using button >>>>>>>>>
    /*
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {

        MenuInflater menuInflater = getMenuInflater();
        menuInflater.inflate(R.menu.add_new, menu);

        return super.onCreateOptionsMenu(menu);
    }

    @Override //Menüyü seçersek ne olacak onu belirler.
    public boolean onOptionsItemSelected(MenuItem item) {

        if (item.getItemId() == R.id.add_new) {

            Intent intent = new Intent(getApplicationContext(), Main2Activity.class);
            intent.putExtra("info", "new"); //Bu satırda amaç eğer yeni bir resimmi yoksa eski resimmi görentülenmek isteniyor onu anlamak
            startActivity(intent);
        }

        return super.onOptionsItemSelected(item);
    }
    */

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

        listView = (ListView) findViewById(R.id.listview); //<<<< CHANGED as declared as class variable

        //<<<<<<<<<< Code below for the conveince of using a button instead of Menu >>>>>>>>>>
        addbutton = (Button) findViewById(R.id.addnew);
        addbutton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getApplicationContext(), Main2Activity.class);
                intent.putExtra("info", "new"); //Bu satırda amaç eğer yeni bir resimmi yoksa eski resimmi görentülenmek isteniyor onu anlamak
                startActivity(intent);
            }
        });
        //<<<<<<<<<< End of code for Button handling >>>>>>>>>>

        setupListView();

        //<<<<<<<<<< NOTE commented out Code >>>>>>>>>>
        /*
        //Databaseden çektiğimiz dataları kaydedeceğimiz bir arraylist oluşturalım ve listview ile bağlayalım
        final ArrayList<String> newName = new ArrayList<String>();
        final ArrayList<String> newName2 = new ArrayList<String>();
        final ArrayList<String> newName3 = new ArrayList<String>();
        newImage = new ArrayList<Bitmap>();

        ArrayAdapter arrayAdapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1,newName);
        listView.setAdapter(arrayAdapter);

        //uygulama ilk açıldığında database'de kayıtlı bir şey varmı bakmasını istiyoruz aşağıdaki aşamalarda

        try {

            Main2Activity.database = this.openOrCreateDatabase("Yeni", MODE_PRIVATE, null);
            Main2Activity.database.execSQL("CREATE TABLE IF NOT EXISTS yeni (name VARCHAR, name2 VARCHAR, name3 VARCHAR, image BLOB)");

            Cursor cursor = Main2Activity.database.rawQuery("SELECT * FROM yeni", null); //Data çekmek için cursoru kullanıyoruz

            int nameIx = cursor.getColumnIndex("name");
            int name2Ix = cursor.getColumnIndex("name2");
            int name3Ix = cursor.getColumnIndex("name3");
            int imageIx = cursor.getColumnIndex("image");

            cursor.moveToFirst();

            while (cursor != null) {

                newName.add(cursor.getString(nameIx)); //Kullanıcının girdği ismi newName'in içine ekle
                newName2.add(cursor.getString(name2Ix));
                newName3.add(cursor.getString(name3Ix));

                byte[] byteArray = cursor.getBlob((imageIx));
                Bitmap image = BitmapFactory.decodeByteArray(byteArray,0,byteArray.length);
                newImage.add(image); //newImage'in içine ekle diyoruz

                cursor.moveToNext();

                arrayAdapter.notifyDataSetChanged();//Eğer bir datayı değiştirdiysek hemen güncelleyen bir konut
            }

        } catch (Exception e) {
        }
        */
    }
    //<<<< ADDED to handle return from child >>>>
    @Override
    public void onResume() {
        super.onResume();
        setupListView();
    }

    //<<<< ADDED to utilise a single refreshable ListView
    private void setupListView() {
        getListsFromDatabase();
        if (arrayadpater == null) {
            arrayadpater = new ArrayAdapter<>(this,android.R.layout.simple_list_item_1,nameList);
            listView.setAdapter(arrayadpater);
            listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

                    Intent intent = new Intent (getApplicationContext(), Main2Activity.class);
                    intent.putExtra("info", "old");
                    intent.putExtra("name", nameList.get(position));
                    intent.putExtra("name2", name2List.get(position));
                    intent.putExtra("name3", name3List.get(position));
                    intent.putExtra("position", position);
                    startActivity(intent);
                }
            });
        } else {
            arrayadpater.notifyDataSetChanged();
        }
    }

    //<<<< Added to build/rebuild the Arraylist's used by the ListView
    private void getListsFromDatabase() {
        // Get the database (and set the databse for Main2Acticity)
        SQLiteDatabase db = openOrCreateDatabase(
                "Yeni",
                MODE_PRIVATE,
                null
        );
        db.execSQL("CREATE TABLE IF NOT EXISTS yeni (name VARCHAR, name2 VARCHAR, name3 VARCHAR, image BLOB)");
        Main2Activity.database = db;

        // Initialise or clear the array lists
        if (nameList == null) {
            nameList = new ArrayList<>();
        } else {
            nameList.clear();
        }
        if (name2List == null) {
            name2List = new ArrayList<>();
        } else {
            name2List.clear();
        }
        if (name3List == null) {
            name3List = new ArrayList<>();
        } else {
            name3List.clear();
        }
        if (newImage == null) {
            newImage = new ArrayList<>();
        } else {
            newImage.clear();
        }
        // get the
        Cursor cursor = db.query("yeni",
                null,
                null,
                null,
                null,
                null,
                null
        );
        while (cursor.moveToNext()) {
            nameList.add(cursor.getString(cursor.getColumnIndex("name")));
            name2List.add(cursor.getString(cursor.getColumnIndex("name2")));
            name3List.add(cursor.getString(cursor.getColumnIndex("name3")));
            byte[] b = cursor.getBlob(cursor.getColumnIndex("image"));
            Bitmap bmp = BitmapFactory.decodeByteArray(b,0,b.length);
            newImage.add(bmp);
        }
        cursor.close();
    }
}
  • 备注 为了我的方便而不是菜单,使用了一个按钮。
  • 要使用菜单,请删除为按钮使用而注释的代码并取消注释
    使用菜单的代码。

  • 终于解决了第 5 个问题

    Main2Activity删除 2 行:-
        Intent intent = new Intent(getApplicationContext(), MainActivity.class); //kaydet'e bastığında anasayfaya yönlendirilsin
        startActivity(intent);
    

    然后添加该行:-
        this.finish(); //<<<< ADD this to finish Main2Activity and return to MainActivity
    

    结果

    刚开始时:-

    enter image description here

    单击添加(相当于从菜单中选择添加):-

    enter image description here

    就在单击保存(打我)按钮之前:-

    enter image description here

    单击 Save (Hit Me) 按钮后(即返回 MainActivity)

    enter image description here

    单击列表中的项目(更新)

    enter image description here

    关于java - 尝试使用 SqliteDatabase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50671821/

    相关文章:

    java - Spring Scoped Proxy 适用于 Scoped Proxy Beans 字段的字段而不是 beans 本身?

    java - Android WebView拒绝用户输入和触摸

    java - 使用后清理FutureTask

    java - Java包装器作为守护程序

    sql - Btrim 函数在 PostgreSQL 中无法正常工作

    MySQL 使用 GROUP BY 对多列进行分组

    java - 如何从本地资源的 Uri 类获取 int?

    android - 在 EditText 中只允许 1 个字符,并且在用户输入时始终覆盖

    android - 带 AppCompatActivity 的 ActionBarDrawerToggle 和带 fragment 的工具栏后退按钮

    php - 如何分解用逗号分隔的多个单词并进行检查