title: How to store text field of toast into a database?
body: <p>I have been writing this code for getting location. How to store <code>mg</code> in <code>SQLite</code> database of <code>android</code>?</p>
  
  <pre><code>public void onLocationChanged(Location location) {                                   
          String mg = " Latitude:" + location.getLatitude() + " Longitude:" + location.getLatitude();                                                              
         Toast.makeText(getBaseContext(),mg, Toast.LENGTH_LONG).show();
  </code></pre>
  
  <p>I have tried this:-</p>
  
  <pre><code>public void locate(View view) { 
      //to insert 
      ContentValues cv=new ContentValues();
      cv.put("mgs",locationtext.getText().toString()); 
      long id = mSQLiteDb.insert("Location",null,cv);
     //Toast.makeText(MainActivity.this,String.valueOf(id),Toast.‌​LENGTH_LONG).show();
  </code></pre>
  
  <p>It did not store, so I doubt that I can we store the text field of Toast method?</p>