Skip to content

Instantly share code, notes, and snippets.

@codinguser
Created August 8, 2012 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codinguser/3293391 to your computer and use it in GitHub Desktop.
Save codinguser/3293391 to your computer and use it in GitHub Desktop.
Creating accounts and transactions in GnucashMobile using Intents
Intent intent = new Intent(Intent.ACTION_INSERT);
intent.putExtra(Intent.EXTRA_TITLE, "Intent Account");
intent.putExtra(Intent.EXTRA_UID, "intent-account");
intent.putExtra("org.gnucash.android.extra.currency_code", "EUR");
intent.setType("vnd.android.cursor.item/vnd.org.gnucash.android.account");
sendBroadcast(intent);
Intent transactionIntent = new Intent(Intent.ACTION_INSERT);
transactionIntent.setType("vnd.android.cursor.item/vnd.org.gnucash.android.transaction");
transactionIntent.putExtra(Intent.EXTRA_TITLE, "Transaction intents");
transactionIntent.putExtra(Intent.EXTRA_TEXT, "You can do this too!");
transactionIntent.putExtra("org.gnucash.android.extra.amount", 4.99);
transactionIntent.putExtra("org.gnucash.android.extra.account_uid", "intent-account");
sendBroadcast(transactionIntent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment