now i want two of my activities gain access to the same databases. i have one main activity and second activity.. main activity inserts some value into the database and after started the second activity by main activity , the second one should call the same database and read the tables and should return the list..in my case its not working main activity successfully inserted the values into the database but second activity failed to return the values. it always returns empty list...please help me...here is the coding for second activity accessing the database...
public class SecondActivty extends Activity
{
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.screen);
list<String> objlist=new ArrayList<String>();
objlist=objdatabase.getdetail(accessCode);
if(objlist.size()!=0)
{
Toast.makeText(this,"got values", Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(this,"no value", Toast.LENGTH_LONG).show();
}
}
}
0 comments:
Post a Comment