Search in sources :

Example 26 with Intent

use of android.content.Intent in project coinbase-bitmonet-sdk by coinbase.

the class CoinbasePaymentProcessor method checkWalletAndSendMoney.

public void checkWalletAndSendMoney(Context context, String item, double amount) {
    // Check if there is a valid receiving address
    if (UserProfileSettings.getInstance().retrieveMerchantReceivingAddress() == null) {
        ((BitmonetPaymentStatusListener) context).paymentFailure(getErrorsAarrayFromString(Constants.ERROR_INVALID_RECEIVING_ADDRESS));
        return;
    }
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(URLUtils.constructBitcoinIntentURL(amount)));
    // Check if there a wallet to handle the intent
    PackageManager manager = context.getPackageManager();
    List<ResolveInfo> activities = manager.queryIntentActivities(intent, 0);
    if (activities.size() > 0) {
        context.startActivity(intent);
    } else {
        showModalAndTransferMoney(context, item, amount);
    }
}
Also used : ResolveInfo(android.content.pm.ResolveInfo) BitmonetPaymentStatusListener(com.bitmonet.BitmonetPaymentStatusListener) PackageManager(android.content.pm.PackageManager) Intent(android.content.Intent)

Example 27 with Intent

use of android.content.Intent in project cw-omnibus by commonsguy.

the class RotationFragment method pickContact.

public void pickContact(View v) {
    Intent i = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
    startActivityForResult(i, PICK_REQUEST);
}
Also used : Intent(android.content.Intent)

Example 28 with Intent

use of android.content.Intent in project cw-omnibus by commonsguy.

the class RotationFragment method pickContact.

public void pickContact(View v) {
    Intent i = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
    startActivityForResult(i, PICK_REQUEST);
}
Also used : Intent(android.content.Intent)

Example 29 with Intent

use of android.content.Intent in project cw-omnibus by commonsguy.

the class RotationRetainDemo method pickContact.

public void pickContact(View v) {
    Intent i = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
    startActivityForResult(i, PICK_REQUEST);
}
Also used : Intent(android.content.Intent)

Example 30 with Intent

use of android.content.Intent in project cw-omnibus by commonsguy.

the class FilesCPDemo method onCreate.

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(FileProvider.CONTENT_URI + "test.pdf"));
    i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
    startActivity(i);
    finish();
}
Also used : Intent(android.content.Intent)

Aggregations

Intent (android.content.Intent)13686 PendingIntent (android.app.PendingIntent)2730 View (android.view.View)1004 ComponentName (android.content.ComponentName)943 Bundle (android.os.Bundle)841 ResolveInfo (android.content.pm.ResolveInfo)743 Uri (android.net.Uri)707 Context (android.content.Context)663 RemoteException (android.os.RemoteException)657 TextView (android.widget.TextView)624 PackageManager (android.content.pm.PackageManager)524 Test (org.junit.Test)509 IntentFilter (android.content.IntentFilter)496 ArrayList (java.util.ArrayList)465 ActivityNotFoundException (android.content.ActivityNotFoundException)376 ImageView (android.widget.ImageView)375 BroadcastReceiver (android.content.BroadcastReceiver)354 IOException (java.io.IOException)353 File (java.io.File)337 Notification (android.app.Notification)283