我正在尝试在ios app Applauze中制作自定义Listview.
我扩展了listview类,并在onTouchEvent的帮助下尝试检测子行的移动并更改其移动高度.因此,与其他行相比,最顶层的孩子具有最大的高度.
public class CustView extends ListView{
private float mLastTouchY;
private int mActivePointerId;
private boolean up=false;
private boolean down=false;
private final Camera mCamera = new Camera();
private final Matrix mMatrix = new Matrix();
private Context context;
private Paint mPaint;
public CustView(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
this.setChildrenDrawingOrderEnabled(true);
}
public CustView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
@Override
protected boolean drawChild(Canvas canvas, View child, long drawingTime) …Run Code Online (Sandbox Code Playgroud) 我有两个数据库Mydb.db和Updatedb.db.它们具有相同的结构并且都具有相同的结构Table1.
我想将所有记录添加Updatedb.db到Table1.
有大约25000条记录需要更新.
我用了:
mDataBase.openDataBaseForWrite();
SQLiteDatabase myInternalDatabase = mDataBase.getDb();
myInternalDatabase.execSQL("ATTACH DATABASE '" + ATTACH_DB_PATH
+ File.separator + ATTACH_DB_NAME + "' AS New_DB");
myInternalDatabase
.execSQL("INSERT INTO ResultMaster SELECT * FROM New_DB.ResultMaster;");
Run Code Online (Sandbox Code Playgroud)
我得到这个例外:
09-16 14:44:32.584: E/AndroidRuntime(2766): FATAL EXCEPTION: main
09-16 14:44:32.584: E/AndroidRuntime(2766): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database: /mnt/sdcard/AttachDb/backupname.db (code 14)
09-16 14:44:32.584: E/AndroidRuntime(2766): at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
09-16 14:44:32.584: E/AndroidRuntime(2766): at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:727)
09-16 14:44:32.584: E/AndroidRuntime(2766): at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
09-16 14:44:32.584: E/AndroidRuntime(2766): at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
09-16 …Run Code Online (Sandbox Code Playgroud)