To access data in Activity A, use onActivityResult () in step A as follows:
@Override protected void onActivityResult(int requestCode, int resultCode, ntent intent) { super.onActivityResult(requestCode, resultCode, intent); if (requestCode == PICK_CONTACT_REQUEST && resultCode == 10) { pos = intent.getIntExtra("doc_id", 1); mDbHelper.open(); mDbHelper.close(); } }
And also remember that you can use this method with the intention method with a call to startActivityForResult() with the intention that this is what you should do
If there is any confusion, you may ask
EDIT: this code will help in getting data
public class FirstActivity extends Activity { AnyDBAdapter mDbHelper = new AnyDBAdapter(this); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mDbHelper.open(); Cursor foemiCursor = mDbHelper.fetchAll(); startManagingCursor(foemiCursor); foemiCursor.close(); mDbHelper.close(); }
Nikki source share