Android Project Clean导致应用程序失败

Android Project Clean导致应用程序失败,android,Android,我刚刚在一个正常工作的应用程序上从ADT进行了清理,现在它崩溃了。这是我所知道的 这里是主要的应用程序 public class MainActivity extends Activity { private GolferDBManager mydManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setConte

我刚刚在一个正常工作的应用程序上从ADT进行了清理,现在它崩溃了。这是我所知道的

这里是主要的应用程序

public class MainActivity extends Activity {
private GolferDBManager mydManager;


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

    // Go get the Known Golfers
    mydManager = new GolferDBManager(this);
    mydManager.openReadable();
    mydManager.retrieveGolfers();
    mydManager.close();

}
下面是GolferDBManager类:

public class GolferDBManager {
public static final String DB_NAME = "golfgames";
public static final String DB_TABLE = "golfers";
public static final int DB_VERSION = 1;
private static final String CREATE_TABLE = "CREATE TABLE " + DB_TABLE + " (index INTEGER PRIMARY KEY, golfer_name TEXT, golfer_init TEXT, usga_index DOUBLE);";
private SQLHelper helper;
private SQLiteDatabase db;
private Context context;


public GolferDBManager(Context c){
    this.context = c;
    helper=new SQLHelper(c);
    this.db = helper.getWritableDatabase();
}
public class SQLHelper extends SQLiteOpenHelper {
    public SQLHelper(Context c){
        super(c, DB_NAME, null, DB_VERSION);
    }
它在飞机上坠毁了

    this.db = helper.getWritableDatabase();
一线

        mydManager = new GolferDBManager(this);
2行进入主应用程序

清洁把数据库搞砸了吗

这是调试堆栈

Thread [<1> main] (Suspended (exception RuntimeException))  
<VM does not provide monitor information>   
ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2211    
ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2261 
ActivityThread.access$600(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 141    
ActivityThread$H.handleMessage(Message) line: 1256  
ActivityThread$H(Handler).dispatchMessage(Message) line: 99 
Looper.loop() line: 137 
ActivityThread.main(String[]) line: 5103    
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  
Method.invoke(Object, Object...) line: 525  
ZygoteInit$MethodAndArgsCaller.run() line: 737  
ZygoteInit.main(String[]) line: 553 
NativeStart.main(String[]) line: not available [native method]  
谢谢。

在数据库中定义字段时,我使用索引作为字段名

CREATE_TABLE= ...
。不知道为什么它会在一段时间内起作用——它永远不应该起作用。但是把它改成另一个名字解决了这个问题

谢谢你的关注


ddk

Hi..请粘贴堆栈跟踪以便我们可以帮助您。刚刚添加的debug stack.index是sqlite中的一个关键字,因此我们无法使用它。
CREATE_TABLE= ...