blockchain/My-Wallet-Android — pull request #27 by tbak42 (2013-10-02 09:29:05+00:00)
Title: Make SendCoins work when starting intent from an external app.

Hello,

This is a fix for Issue #9.

Previously, trying to send Bitcoins from another app using the Blockchain Android app would not work. For example, if you tap on a "bitcoin:XXXXX" link in Chrome for Android, SendCoinsActivity will not properly fill out the destination address.

Similarly, Android apps that try to start blockchain to send some coins will experience the same problem:

String url = "bitcoin://" + address;
Intent intent = new Intent( Intent.ACTION_VIEW );
intent.setData( Uri.parse(url));
startActivity( intent ); // does not work properly

The problem seems to be caused by the Android system not always calling onNewIntent(). If the blockchain activity has not already been created, Android will only call onCreate(), but not onNewIntent(). This results in none of the input fields being set.

Hope this helps!

Cheers,

Tom