SQLite查询数据之后传过去报错,不知道该怎么办了-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

SQLite查询数据之后传过去报错,不知道该怎么办了

a123456678 2016-07-19 14:25:18 1290

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.baidu.mapapi.SDKInitializer;

import entity.point;

public class detailed extends Activity {

private ImageView img;

private TextView lng;

@Override
protected void onCreate(Bundle savedInstanceState,SQLiteHelper msh,int pointId) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.self_layout);

    img = (ImageView)findViewById(R.id.vr);
    img.setOnClickListener(new ImageView.OnClickListener(){

        @Override
        public void onClick(View v) {
            Intent intent = new Intent();
            intent.setClass(detailed.this,panorama.class);
            startActivity(intent);
        }
    });
    point lngText = SQLiteHelper.getdetailedById(msh,1);
    lng = (TextView)findViewById(R.id.lngText);
    lng.setText("lngText");
}

}

~~~~SQLiteHelper类~~~~

/**

 * 根据ID查询所有信息
 * @return 返回一个对象s
 */
public static point getdetailedById(SQLiteHelper msh,int pointId) {
    point po = new point();
    SQLiteDatabase db = msh.getWritableDatabase();
    Cursor cursor = db.rawQuery(
            "select lng,lat,direction,uniformity,temperature,dustproof,material,metope,door,illumination," +
                    "type from vr_point where pointID = "
                    + pointId, null);
    if (cursor.moveToFirst()) {
        do {
            po.setLng(cursor.getDouble(0));
            po.setLat(cursor.getDouble(1));
            po.setDirection(cursor.getString(2));
            po.setUniformity(cursor.getString(3));
            po.setTemperature(cursor.getString(4));
            po.setDustproof(cursor.getString(5));
            po.setMaterial(cursor.getString(6));
            po.setMetope(cursor.getString(7));
            po.setDoor(cursor.getString(8));
            po.setIllumination(cursor.getString(9));
            po.setType(cursor.getString(10));
        } while (cursor.moveToNext());
    }
    cursor.close();
    return po;
}
    报错!不知道怎么写了,改了很多次。求救,十万火急,赶着交差[图片说明](http://img.ask.csdn.net/upload/201603/22/1458654196_340606.png)
数据库管理
分享到
取消 提交回答
全部回答(1)
  • a123456678
    2019-07-17 19:58:22

    activity只有public void onCreate (Bundle savedInstanceState){方法
    没有
    protected void onCreate(Bundle savedInstanceState,SQLiteHelper msh,int pointId) {

    0 0
数据库
使用钉钉扫一扫加入圈子
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

推荐文章
相似问题