Tag Archives: cursor

Android EditText cursor control, color modification, show and hide

Modify the Android EditText cursor color:

QQ group: 372135639

EditText has one property: android:textCursorDrawable This property is used to control the color of the cursor

android:textCursorDrawable= ”@The function of “null” and “@ null” is to make the cursor color the same as text color

Android set EditText cursor color and thickness:

In the Android input box, if you want to change the color and thickness of the cursor, you can do it in the following two steps:

1. Create a new cursor control color in the resource file drawable_ cursor.xml

<?xml version="1.0" encoding="utf-8"?>  
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">  
    <size android:width="1dp" />  
    <solid android:color="#008000"  />  
</shape>  

Set the EditText cursor to show/hide

android:cursorVisible= ”True “//displays
the android:cursorVisible= ”False “//hide

Note: default display

//The cursor displays the problem by default. It will not be displayed by default on Meizu mx6. (it is better to control the display and hiding of cursor by code)

Cursor window allocation of 2048 kb failed


cannot create Cursor because the system is out of memory. The following is the block of code

that is in question

public void insertCBJL(ArrayList<CBJLBean> cbjlList) {
        if (cbjlList.size() > 0) {
            mysql.beginTransaction();
            for (CBJLBean bean : cbjlList) {
                Cursor cursor = mysql.rawQuery(
                "select * from cbjl_table where yhh=?", 
                new String[] { bean.getYhh()});
                if (cursor.getCount() > 0) {
                    continue;
                }
                mysql.execSQL("insert into     cbjl_table(cbcid,...,scsyql) values (?,...,?)",
            new Object[] { bean.getCbcid(),...,bean.getScsyql() });
            }
            mysql.setTransactionSuccessful();
            mysql.endTransaction();
        }
    }

After the

for loop, there is a query statement that was originally inserted into the database in order for the data to be repeated. However, there is a big mistake. After being used, it is not closed, which causes the memory overflow.