程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> android studio-SQLite查詢數據之後傳過去報錯,不知道該怎麼辦了

android studio-SQLite查詢數據之後傳過去報錯,不知道該怎麼辦了

編輯:編程解疑
SQLite查詢數據之後傳過去報錯,不知道該怎麼辦了
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)

最佳回答:


 activity只有public void onCreate (Bundle savedInstanceState){方法
 沒有
 protected void onCreate(Bundle savedInstanceState,SQLiteHelper msh,int pointId) {
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved