I have go through many questions and answers and found out that changing database version will forced to create new table....
i also tried to create table with new name but same error occurred.... 

---

```
08-17 17:58:10.871 21817-21879/com.hp.registration E/Surface: getSlotFromBufferLocked: unknown buffer: 0xaa0da1e0 08-17 17:58:13.274 21817-21817/com.hp.registration E/SQLiteLog: (1) no such table: Regi

08-17 17:58:13.288 21817-21817/com.hp.registration E/SQLiteDatabase: Error inserting States=Hariyana PhoneNo=9874563219 Gender=Male Password=12345 Email=rehan@gmail.com Address=kalol Name=Rehan

```

---

I SIMPLY CREATED REGISTRATION FORM AND TRYING TO STORE DATA INTO DATABASE AND MY JAVA CODE OF REGISTERACTIVITY(MAINACTIVITY) FILE IS...

---

```
public class RegisterActivity extends Activity implements View.OnClickListener, AdapterView.OnItemSelectedListener {
EditText edtName, edtPhoneNo, edtemail, edtpassword, edtconformpassword, edtAddress;
RadioGroup radio;
boolean isvalid = true;
RadioButton radmale, radfemale;
Button btnregister,btnUpdate,btnDelete;
Spinner spinner;
TextView tv;
private static final String tablename = "Mydb1";

String strGender1;
Global_alert_box_main2 alert = new Global_alert_box_main2();
String item;

MyHelper mh;
SQLiteDatabase database;
Context context;

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

    getIds();
    mh=new MyHelper(this);
    database=mh.getWritableDatabase();

   spinner = (Spinner) findViewById(R.id.spinner);
    ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.states, android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);
    spinner.setOnItemSelectedListener(this);
}
private void getIds() {
    radio = (RadioGroup) findViewById(R.id.radio);
    radmale = (RadioButton) findViewById(R.id.radmale);
    radfemale = (RadioButton) findViewById(R.id.radfemale);
    edtName = (EditText) findViewById(R.id.edtName);
    edtPhoneNo = (EditText) findViewById(R.id.edtPhoneNo);
    edtemail = (EditText) findViewById(R.id.edtemail);
    edtpassword = (EditText) findViewById(R.id.edtpassword);
    edtconformpassword =(EditText)findViewById(R.id.edtconformpassword);
    edtAddress = (EditText) findViewById(R.id.edtAddress);
    spinner = (Spinner) findViewById(R.id.spinner);

    btnregister=(Button)findViewById(R.id.btnregister);
    btnUpdate=(Button)findViewById(R.id.btnUpdate);
    btnDelete=(Button)findViewById(R.id.btnDelete);

    btnregister.setOnClickListener(this);
    btnUpdate.setOnClickListener(this);
    btnDelete.setOnClickListener(this);
}

public void onClick(View v) {
    String  states, gender, name, phoneno, email, address, password;

    name = edtName.getText().toString();
    phoneno = edtPhoneNo.getText().toString();
    email = edtemail.getText().toString();
    address = edtAddress.getText().toString();
    password = edtpassword.getText().toString();
    states = item;

    switch (v.getId()) {

        case R.id.btnregister:
            validate();

            int i = radio.getCheckedRadioButtonId();

            RadioButton radiobtn = (RadioButton) findViewById(i);

            strGender1 = radiobtn.getText().toString();

            //  int gendervalue=gender("male");
            //    Intent intent=new Intent(this,);

          gender = radiobtn.getText().toString();
            long l= mh.insertData(name, phoneno,gender,address,email,password,states,database);

            if(l==-1)
            {

                Toast.makeText(this,"UnSuccessfull Inserted! ",Toast.LENGTH_LONG).show();
            }
            else
            {

                Toast.makeText(this,"Save Record Successfully!",Toast.LENGTH_LONG).show();
            }

            break;

            case R.id.btnUpdate:
            Intent updateIntent=new Intent(RegisterActivity.this,UpdateActivity.class);
            startActivity(updateIntent);
            break;

        case R.id.btnDelete:

            Intent del=new Intent(this,delete_activity.class);
            startActivity(del);
            break;
    }
}

```

---

AND THIS IS MY HELPER CLASSS

---

```
public class MyHelper extends SQLiteOpenHelper {
    private static final String DBname="students";
   // private static final String TBname="registration";
   private static final String tbname="Regi";
    String str="CREATE TABLE IF NOT EXISTS "+tbname+" (id integer primary key autoincrement,NAME text,PHONENO text,GENDER text,ADDRESS text,EMAIL text,PASSWORD text,STATES text)";

    SQLiteDatabase db;
    MyHelper mh;
    Context context;
    private static final String id="id";
    private static final String fname="FirstName";
    private static final String lname="LastName";

    public MyHelper(Context context) {
        super(context, DBname, null, 1);

        db=this.getReadableDatabase();
        db=this.getWritableDatabase();
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        db.execSQL(str);
        Log.e("Table", "Table has been created");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("DROP TABLE IF EXISTS" + tbname);
        onCreate(db);
    }

    public long insertData(String NAME, String PHONENO,String GENDER,String ADDRESS,String EMAIL,String PASSWORD,String STATES, SQLiteDatabase db)
    {

        ContentValues contentValues=new ContentValues();
        contentValues.put("Name",NAME);
        contentValues.put("PhoneNo",PHONENO);
        contentValues.put("Gender",GENDER);
        contentValues.put("Address",ADDRESS);
        contentValues.put("Email",EMAIL);
        contentValues.put("Password",PASSWORD);
        contentValues.put("States", STATES);
        long status=db.insert(tbname, null, contentValues);
        return status;
    }
}

```

---