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 8380267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:24:48+00:00 2026-06-09T16:24:48+00:00

Android app A has Internet access: <uses-permission android:name=android.permission.INTERNET/> App B does not have Internet

  • 0

Android app A has Internet access:

<uses-permission android:name="android.permission.INTERNET"/>

App B does not have Internet access. So I want to give Internet access from app A to app B via a PendingIntent. This is what PendingIntent is for, isn’t it?

By giving a PendingIntent to another application, you are granting it the right to perform the operation you have specified as if the other application was yourself (with the same permissions and identity).

This is how I send the PendingIntent in app A:

Intent mainApp = new Intent(Intent.ACTION_MAIN);
mainApp.addCategory(Intent.CATEGORY_LAUNCHER);
mainApp.setClassName("com.other.package", "com.other.package.MainActivity");
int flags = PendingIntent.FLAG_UPDATE_CURRENT | Intent.FLAG_ACTIVITY_NEW_TASK;
PendingIntent pi = PendingIntent.getActivity(this, 23894729834, mainApp, flags);
try {
    pi.send();
}
catch (CanceledException e) { }

And this is how I try to receive it in app B (which has launchMode=singleTask):

@Override
protected void onNewIntent(Intent i) {
    setIntent(i);
    // do some things with Internet access here
}

But it doesn’t work! Do you know why? What did I do wrong?

Thanks in advance!

  • 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-09T16:24:50+00:00Added an answer on June 9, 2026 at 4:24 pm

    So I want to give Internet access from app A to app B via a PendingIntent.

    That is not possible, sorry.

    This is what PendingIntent is for, isn’t it?

    No.

    Let’s look more closely at the portion of the documentation that you quoted:

    By giving a PendingIntent to another application, you are granting it the right to perform the operation you have specified as if the other application was yourself (with the same permissions and identity).

    (boldface mine for emphasis)

    App B can execute the PendingIntent via send(), and it will run as if App A had executed it, if you were to send the PendingIntent to App B (e.g., as an Intent extra). However:

    • You are having App A execute the PendingIntent via send(), starting up App B, rather than sending the PendingIntent to App B.

    • App B does not magically get App A’s permissions, just because it happened to be invoked via some PendingIntent created by App A.

    There is no way for you to “give Internet access from app A to app B” by any means. App B can ask App A to perform requests upon its behalf (e.g., via commands sent to a service exposed by App A). However, you will want to take great care when doing this, as by default not only will you be able to ask App A to do things, but so can any other app on the device, unless you use a signature-level custom permission to protect App A’s exported service.

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

Sidebar

Related Questions

my android app already has the following permission: android.permission.INTERNET I want to use the
My android app has a two word app name, and the 2nd word doesn't
I have an android app which has native code. The native code needs to
I have an Android app that has an Application class and I have another
I've got an Android app which has a periodic background Service. I want this
I'm trying to test an application that has on the Manifest: <uses-feature android:name=android.hardware.telephony android:required=false
My Android app has a main WebView (HTML loaded from a local resource) which
I have an android app that has to be restricted to portrait mode, and
I Have created an android app, which has view flipper and it has 4
I have an android app that connects to the internet to do a reverse

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.