Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9147209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:55:56+00:00 2026-06-17T10:55:56+00:00

Here’s what I’m trying to achieve: Widget with 3 buttons: 1. View folder 2.

  • 0

Here’s what I’m trying to achieve:
Widget with 3 buttons:
1. View folder
2. Add item
3. Add item and start a camera to attach a photo to the item.

I was hoping to achieve 2&3 by using an Intent with extras, just add a boolean extra “photo” to hold true if the 3rd button was clicked, here’s my code:

Intent intent = new Intent(Intent.ACTION_INSERT);
        intent.setData(Uri.parse("content://"
                + NoteProviderMetaData.AUTHORITY + "/folders/"
                + folderId));
intent.putExtra("photo", false);
intent.putExtra("kind", "NO PHOTO");
intent.setAction(Intent.ACTION_INSERT);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
views.setOnClickPendingIntent(R.id.imageButton2, pendingIntent);

Intent intentFolder = new Intent(Intent.ACTION_VIEW);
        intentFolder.setData(Uri.parse("content://"
                + NoteProviderMetaData.AUTHORITY + "/folders/"
                + folderId + "/notes"));
PendingIntent pendingIntentFolder = PendingIntent.getActivity(this, 0, intentFolder, 0);
Intent intentPhoto = new Intent(Intent.ACTION_INSERT);
intentPhoto.setData(Uri.parse("content://"
        + NoteProviderMetaData.AUTHORITY + "/folders/"
                + folderId));
intentPhoto.putExtra("photo", true);
intentPhoto.putExtra("kind", "PHOTO");
intentPhoto.setAction(Intent.ACTION_INSERT);
PendingIntent pendingIntentPhoto = PendingIntent.getActivity(this, 0, intentPhoto, 0);
views.setOnClickPendingIntent(R.id.imageButton3, pendingIntentPhoto);

The problem is that immediately after I create pendingIntentPhoto my pendingIntent extras are overridden by new values and I always get true and PHOTO values in my activity.
pendingFolder intent works, so I guess it would be fine just to use another intent action but I’d like to understand how this PendingIntent thing works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:55:58+00:00Added an answer on June 17, 2026 at 10:55 am

    I was able to achieve this using this method’s undocumented feature:

    public static PendingIntent getActivity (Context context, int requestCode, Intent intent, int flags)

    From the docs:
    requestCode Private request code for the sender (currently not used).

    Apparently this code is currently used somehow. Supplying different requestCodes to this method calls allowed me to create different PendingIntents for the same widget.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is what I am trying to achieve in PHP: I have this string:
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here is the code in a function I'm trying to revise. This example works
Here's the setup - I have a view that lists products. On that same
Here is my problem.. I have the option to create(add) two new input fields,
Here are the tables I have: Table A which has entries with item and
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Here is the field declaration in a form: max_number = forms.ChoiceField(widget = forms.Select(), choices
Here I am trying to retrieve the response from the server and display it,
Here's what I'm trying to do... It's quite simple and obviously there must be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.