Last active
March 9, 2019 17:03
-
-
Save parahall/b29b9dff205436f24c9122c208072f04 to your computer and use it in GitHub Desktop.
NewOrderPresenter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NewOrderPresenter extends BasePresenter<NewOrderView> { | |
//... | |
private int insertOrder(Order order) { | |
//turn order to ContentValues object (used by SQL to insert values to Table) | |
ContentValues values = order.createLocalOrder(order); | |
//call resolver to insert data to the Order table | |
Uri uri = context.getContentResolver().insert(KolGeneContract.OrderEntry.CONTENT_URI, values); | |
//get Id for order. | |
if (uri != null) { | |
return order.getLocalId(); | |
} | |
return -1; | |
} | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment