基于Android的课程表,课表主体完成了。功能是点击空白格子处增加课程信息。但是真机调试时点击保存按钮后所输入的课程信息并没有出现在选中的空白格子上,并调试时一直报一个错误W/System: ClassLoader referenced unknown path: /data/app/com.example.b-2/lib/arm64不知道为什么。是这个报错导致没有实现预期功能还是代码存在问题,网上解决办法差不多都试过了,还是无法解决。请各位前辈帮忙看看,非常感谢。附上MainActivity.java的代码
如下:`package com.example.b;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.content.Context;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends Activity implements View.OnClickListener {
protected DBHelper myDb;
private SQLiteDatabase dbReader,dbWriter;
private Button buttonSet;
protected boolean flag=false;
public TextView tv11,tv12,tv13,tv14,tv15,
tv21,tv22,tv23,tv24,tv25,
tv31,tv32,tv33,tv34,tv35,
tv41,tv42,tv43,tv44,tv45;
//public TextView txMon,txTus,txWed,txThurs,txFri,txSatur,txSun;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
intiviews();//找到view
//实例化DB
myDb=new DBHelper(this);
dbWriter=myDb.getWritableDatabase();
dbReader=myDb.getReadableDatabase();
//第一次App运行初始化数据库
intailDB();
setTextListenners();//设置点击事件
setTextContent();//从SQL读取数据
}
//找到view
private void intiviews(){
tv11=findViewById(R.id.tv11);
tv12=findViewById(R.id.tv12);
tv13=findViewById(R.id.tv13);
tv14=findViewById(R.id.tv14);
tv15=findViewById(R.id.tv15);
tv21=findViewById(R.id.tv21);
tv22=findViewById(R.id.tv22);
tv23=findViewById(R.id.tv23);
tv24=findViewById(R.id.tv24);
tv25=findViewById(R.id.tv25);
tv31=findViewById(R.id.tv31);
tv32=findViewById(R.id.tv32);
tv33=findViewById(R.id.tv33);
tv34=findViewById(R.id.tv34);
tv35=findViewById(R.id.tv35);
tv41=findViewById(R.id.tv41);
tv42=findViewById(R.id.tv42);
tv43=findViewById(R.id.tv43);
tv44=findViewById(R.id.tv44);
tv45=findViewById(R.id.tv45);
buttonSet=fin