mchammer9111 Posted June 19, 2012 Share Posted June 19, 2012 So I'm making an app that displays products on a ListView using a SimpleAdapter and basically what I have done is create a database object and I can send a product object to have it saved to the database or I return either individual products or an ArrayList of products. In my ListView activity I create an ArrayList of product objects and call the ArrayList return method. Then bind everything to the ListView. When the user selects an item on the ListView it goes into a details page that displays information about the product selected. I was thinking of sending an Intent with the rowID of the product in the database and then have the details screen pull the product from my DataBase object. I was wondering: Would keeping the database open() for the ItemSelected page increase efficency? I could call, Product myProduct = new Product(MainActivity.DataBase.getProduct(SQLRowID))? Or would I just have to create a new DataBase object in the new activity and open() it? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.