this is my code and I dont know whats wrong in the list view. When i click the button, to list all it says no record
and also how can I make all field clear after saving record
public class ProjectDetail extends Activity implements View.OnClickListener{
Button btnsave, btndelete, btnclose;
EditText ettitle, etType, etprio, ettf;
EditText etsd, eted,etcost,etstat;
private int _Project_Id=0;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_project_detail);
    btnsave = (Button) findViewById(R.id.btnSave);
    btndelete = (Button) findViewById(R.id.btnClose);
    btnclose = (Button) findViewById(R.id.btnClose);
    ettitle = (EditText) findViewById(R.id.eTtitle);
    etType = (EditText) findViewById(R.id.eTtype);
    etprio = (EditText) findViewById(R.id.eTprio);
    ettf = (EditText) findViewById(R.id.eTtf);
    etsd = (EditText) findViewById(R.id.eTsd);
    eted = (EditText) findViewById(R.id.eTed);
    etcost = (EditText) findViewById(R.id.eTcost);
    etstat = (EditText) findViewById(R.id.eTstat);
    **_Project_Id=0;
    Intent intent = getIntent();
    _Project_Id = intent.getIntExtra("project_Id", 0);
    ProjectCrud pcrud = new ProjectCrud(this);
    Project project = new Project();
    project = pcrud.getProjectById(_Project_Id);
    ettitle.setText(project.title);
    etType.setText(project.type);
    etprio.setText(String.valueOf(project.priority));
    ettf.setText(project.timeframe);
    etsd.setText(project.start);
    eted.setText(project.end);
    etcost.setText(String.valueOf(project.cost));
    etstat.setText(project.status);
}**
@Override
**public void onClick(View view) {
    if (view == findViewById(R.id.btnSave)){
        ProjectCrud pcrud = new ProjectCrud(this);
        Project project = new Project();
        project.title=ettitle.getText().toString();
        project.type=etType.getText().toString();
        project.priority= Integer.parseInt(etprio.getText().toString());
        project.timeframe=ettf.getText().toString();
        project.start=etsd.getText().toString();
        project.end=eted.getText().toString();
        project.cost=Integer.parseInt(etcost.getText().toString());
        project.status=etstat.getText().toString();
        project.project_ID=_Project_Id;
        if(_Project_Id==0){
            _Project_Id=pcrud.insert(project);
            Toast.makeText(this,"New Project Created", Toast.LENGTH_SHORT).show();
        }else {
            pcrud.update(project);
            Toast.makeText(this,"Project Updated", Toast.LENGTH_SHORT).show();
        }
    }else if (view == findViewById(R.id.btnDelete)){
        ProjectCrud pcrud = new ProjectCrud(this);
        pcrud.delete(_Project_Id);
        Toast.makeText(this,"Project Deleted", Toast.LENGTH_SHORT).show();
        finish();
    }else if (view == findViewById(R.id.btnClose)){
        finish();
    }**
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_project_detail, menu);
    return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 }
this is my code for crud operation
public class ProjectCrud {
private DBHelper dbHelper;
public ProjectCrud(Context context){
    dbHelper = new DBHelper(context);
}
public int insert(Project project){
    SQLiteDatabase db = dbHelper.getWritableDatabase();
    ContentValues values = new ContentValues();
    values.put(Project.KEY_title, project.title);
    values.put(Project.KEY_type, project.type);
    values.put(Project.KEY_priority, project.priority);
    values.put(Project.KEY_timeframe, project.timeframe);
    values.put(Project.KEY_start, project.start);
    values.put(Project.KEY_end, project.end);
    values.put(Project.KEY_cost, project.cost);
    values.put(Project.KEY_status, project.status);
    long project_Id = db.insert(Project.TABLE, null, values);
    db.close();
    return (int) project_Id;
   }
public void delete(int project_Id) {
    SQLiteDatabase db = dbHelper.getWritableDatabase();
    db.delete(Project.TABLE, Project.KEY_ID + "=?", new String[]{ String.valueOf(project_Id) });
    db.close();
}
public void update(Project project){
    SQLiteDatabase db = dbHelper.getWritableDatabase();
    ContentValues values = new ContentValues();
    values.put(Project.KEY_title, project.title);
    values.put(Project.KEY_type, project.type);
    values.put(Project.KEY_priority, project.priority);
    values.put(Project.KEY_timeframe, project.timeframe);
    values.put(Project.KEY_start, project.start);
    values.put(Project.KEY_end, project.end);
    values.put(Project.KEY_cost, project.cost);
    values.put(Project.KEY_status, project.status);
    db.update(Project.TABLE, values, Project.KEY_ID + "= ?", new String[]{String.valueOf(project.project_ID)});
    db.close();
}
public ArrayList<HashMap<String, String>> getProjectList (){
    SQLiteDatabase db = dbHelper.getReadableDatabase();
    String selectQuery = "SELECT " +
            Project.KEY_ID + "," +
            Project.KEY_title + "," +
            Project.KEY_type + "," +
            Project.KEY_priority + "," +
            Project.KEY_timeframe + "," +
            Project.KEY_start + "," +
            Project.KEY_end + "," +
            Project.KEY_cost + "," +
            Project.KEY_status +
            " FROM " + Project.TABLE;
    **ArrayList<HashMap<String, String>> projectList = new ArrayList<HashMap<String, String>>();**
    Cursor cursor= db.rawQuery(selectQuery, null);
    if (cursor.moveToFirst()){
        do {
            HashMap<String , String > project = new HashMap<String, String >();
            project.put("id", cursor.getString(cursor.getColumnIndex(Project.KEY_ID)));
            project.put("title", cursor.getString(cursor.getColumnIndex(Project.KEY_title)));
            projectList.add(project);
        } while (cursor.moveToNext());
    }
    cursor.close();
    db.close();
    return projectList;
    }
public Project getProjectById(int Id){
    SQLiteDatabase db = dbHelper.getReadableDatabase();
    String selectQuery = "SELECT " +
            Project.KEY_ID + "," +
            Project.KEY_title + "," +
            Project.KEY_type + "," +
            Project.KEY_priority + "," +
            Project.KEY_timeframe + "," +
            Project.KEY_start + "," +
            Project.KEY_end + "," +
            Project.KEY_cost + "," +
            Project.KEY_status +
            " FROM " + Project.TABLE
            + " WHERE " +
            Project.KEY_ID + "=?";
    int iCount =0;
    Project project = new Project();
     Cursor cursor = db.rawQuery(selectQuery, new String[]{         String.valueOf(Id)});
    if (cursor.moveToFirst()){
        do{
            project.project_ID =   cursor.getInt(cursor.getColumnIndex(Project.KEY_ID));
            project.title = cursor.getString(cursor.getColumnIndex(Project.KEY_title));
            project.type = cursor.getString(cursor.getColumnIndex(Project.KEY_type));
            project.priority = cursor.getInt(cursor.getColumnIndex(Project.KEY_priority));
            project.timeframe = cursor.getString(cursor.getColumnIndex(Project.KEY_timeframe));
            project.start = cursor.getString(cursor.getColumnIndex(Project.KEY_start));
            project.end = cursor.getString(cursor.getColumnIndex(Project.KEY_end));
            project.cost = cursor.getInt(cursor.getColumnIndex(Project.KEY_cost));
            project.status = cursor.getString(cursor.getColumnIndex(Project.KEY_status));
        }while (cursor.moveToNext());
    }
    cursor.close();
    db.close();
    return project;
}
 }
is there something wrong with my code?
 
     
     
     
     
     
    