Intent getData - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Intent getData method.

This code example shows how to use the following methods:getData
  @Override 
  protected void onActivityResult(int requestCode, int resultCode,
                                    Intent data) {
    if (requestCode==PICK_REQUEST) {
      if (resultCode==RESULT_OK) {
        contact=data.getData();
        viewButton.setEnabled(true);
      } 
    } 
  } 
 
  public void pickContact(View v) {
    Intent i=new Intent(Intent.ACTION_PICK,
                        Contacts.CONTENT_URI);
   
    startActivityForResult(i, PICK_REQUEST);
  } 
   
  public void viewContact(View v) {
    startActivity(new Intent(Intent.ACTION_VIEW, contact));
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getAction, getBooleanExtra, getData
        } 
        handlePackageChangedForVoicemail(context, intent);
    } 
 
    private void handlePackageChangedForVoicemail(Context context, Intent intent) {
        if (intent.getAction().equals(Intent.ACTION_PACKAGE_REMOVED) &&
                !intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
            // Forward the intent to the cleanup service for handling the event. 
            Intent intentToForward = new Intent(context, VoicemailCleanupService.class);
            intentToForward.setData(intent.getData());
            intentToForward.setAction(intent.getAction());
            intentToForward.putExtras(intent.getExtras());
            context.startService(intentToForward);
        } 
    } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getData
  @Override 
  protected void onActivityResult(int requestCode, int resultCode,
                                    Intent data) {
    if (requestCode==PICK_REQUEST) {
      if (resultCode==RESULT_OK) {
        contact=data.getData();
        viewButton.setEnabled(true);
      } 
    } 
  } 
 
  public void pickContact(View v) {
    Intent i=new Intent(Intent.ACTION_PICK,
                        Contacts.CONTENT_URI);
   
    startActivityForResult(i, PICK_REQUEST);
  } 
   
  public void viewContact(View v) {
    startActivity(new Intent(Intent.ACTION_VIEW, contact));
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getData, setData
    } 
 
    @Override 
    protected Uri resolveIntent() {
        Intent intent = getIntent();
        intent.setData(Uri.parse("content://icc/fdn"));
        return intent.getData();
    } 
 
    @Override 
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
 
        Resources r = getResources();
 
        // Added the icons to the context menu 
        menu.add(0, MENU_ADD, 0, r.getString(R.string.menu_add))
                .setIcon(android.R.drawable.ic_menu_add);
        menu.add(0, MENU_EDIT, 0, r.getString(R.string.menu_edit))
                .setIcon(android.R.drawable.ic_menu_edit);
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getAction, getData
    @Override 
    public void onReceive(Context context, Intent intent) 
    {         
        App app = (App) context.getApplicationContext();        
         
        String action = intent.getAction();
         
        boolean isInstalled = !"android.intent.action.PACKAGE_REMOVED".equals(action);
         
        String packageName = intent.getData().getSchemeSpecificPart();
         
        if (packageName != null)
        { 
            if (packageName.startsWith(context.getPackageName() + ".pack"))
            {             
                app.updateExpansionPacks(); 
            } 
        } 
    }         
}     
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getData
  @Override 
  protected void onActivityResult(int requestCode, int resultCode,
                                    Intent data) {
    if (requestCode==PICK_REQUEST) {
      if (resultCode==RESULT_OK) {
        contact=data.getData();
        viewButton.setEnabled(true);
      } 
    } 
  } 
 
  public void pickContact(View v) {
    Intent i=new Intent(Intent.ACTION_PICK,
                        Contacts.CONTENT_URI);
   
    startActivityForResult(i, PICK_REQUEST);
  } 
   
  public void viewContact(View v) {
    startActivity(new Intent(Intent.ACTION_VIEW, contact));
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getData, hasExtra
        intent.putExtra(Intent.EXTRA_SUBJECT, title);
        context.startActivity(intent);
    } 
 
    public boolean isValidIntent(Intent intent) {
        if (!intent.hasExtra(Intent.EXTRA_TEXT)) {
            return false; 
        } 
        if (intent.getData() == null) {
            return false; 
        } 
        return true; 
    } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addFlags, getAction, getData, getExtras, setClassName
 
    @Override 
    protected void onHandleIntent(Intent intent) {
        ComposeMessageActivity.log("NoConfirmationSendService onHandleIntent"); 
 
        String action = intent.getAction();
        if (!TelephonyManager.ACTION_RESPOND_VIA_MESSAGE.equals(action)) {
            ComposeMessageActivity.log("NoConfirmationSendService onHandleIntent wrong action: " + 
                    action);
            return; 
        } 
        Bundle extras = intent.getExtras();
        if (extras == null) {
            ComposeMessageActivity.log("Called to send SMS but no extras"); 
            return; 
        } 
 
        String message = extras.getString(Intent.EXTRA_TEXT);
 
        Uri intentUri = intent.getData();

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getData
		} 
	} 
 
	@Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
 
		if (requestCode == PICK_IMAGE_REQUEST) {
			if (resultCode == Activity.RESULT_OK) {
				imageLocation = data.getData();
 
		        imageSelectedLabel.setText(imageLocation.toString());
		        imageSelectedLabel.setVisibility(View.VISIBLE);
			} 
		} 
	} 
 
	protected Dialog onCreateDialog(int id)	{
		AlertDialog.Builder dialogBuilder = createDialogBuilder(id);
		return dialogBuilder.create();
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getData
  @Override 
  protected void onActivityResult(int requestCode, int resultCode,
                                    Intent data) {
    if (requestCode==PICK_REQUEST) {
      if (resultCode==RESULT_OK) {
        contact=data.getData();
        viewButton.setEnabled(true);
      } 
    } 
  } 
 
  public void pickContact(View v) {
    Intent i=new Intent(Intent.ACTION_PICK,
                        Contacts.CONTENT_URI);
   
    startActivityForResult(i, PICK_REQUEST);
  } 
   
  public void viewContact(View v) {
    startActivity(new Intent(Intent.ACTION_VIEW, contact));
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Intent getData Questions & Answers:

Other Intent getData Examples

42:	          bitmap.recycle();
43:	        }
44:	        stream = getContentResolver().openInputStream(data.getData());
45:	        bitmap = BitmapFactory.decodeStream(stream);
46:

Read More

166:			 * */
167:			if (!isTwitterLoggedInAlready()) {
168:				Uri uri = getIntent().getData();
169:				if (uri != null && uri.toString().startsWith(TWITTER_CALLBACK_URL)) {
170:					// oAuth verifier

Read More

15:			 * */
16:			if (!isTwitterLoggedInAlready()) {
17:				Uri uri = getIntent().getData();
18:				if (uri != null && uri.toString().startsWith(TWITTER_CALLBACK_URL)) {
19:					// oAuth verifier

Read More

getData Method Overview
Retrieve data this intent is operating on.
See Code Examples for other Android Intent Methods: