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

  • Home
  • SEARCH
  • 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 8228777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:34:36+00:00 2026-06-07T16:34:36+00:00

I have an app that needs to display some PDF files. The files are

  • 0

I have an app that needs to display some PDF files. The files are local to the device and the device is used in high-security locations with no web access.

Until Android gets some native ability or libraries to display a PDF file I’m relying on the AdobeReader.apk, which I fire off thusly:

Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(dgfile), "application/pdf");
i.setClassName("com.adobe.reader", "com.adobe.reader.AdobeReader");
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
// ctx is a passed-in Context of my main Activity
try   { 
    ctx.startActivity(i);
}
 catch (ActivityNotFoundException e)    {   // incase no viewer installed
    Log.e("DG_External", "No viewer found!");
}

This works perfectly, but after I’m done displaying I want to stop it and return to my main app. The ‘winning’ answer on this S.O question said if I used a StartActivityForresult() I could do it with a finishActivity() But I couldn’t get it to work (I don’t see how it could work since there’s no instance of the Activity we want to stop)

Still, I changed my StartActivity to:

((Activity)ctx).startActivityForResult(i, 33);  //!!  // 33 = arbitrary r.c.

This invoked the Adobe reader just fine, but doing a …

((Activity)ctx).finishActivity(33);

…produced no result. I tried wrapping it in try/catch and there were no exceptions thrown.

What am I doing wrong and how do I do this right? 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-07T16:34:38+00:00Added an answer on June 7, 2026 at 4:34 pm

    Another way to think about this is how can I bring my app to the top of the display and move AdobeReader to the background?

    Call startActivity() on one of your activities. Something in your app is determining that “the user on the PC closes a document”. That something can call startActivity().

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

Sidebar

Related Questions

I have an app that needs to read a PDF file from the file
I have a MySQL/Rails app that needs search. Here's some info about the data:
When I have a WinForms app that needs to do some heavy lifting in
I have an AJAX app built for mobile Safari browser that needs to display
I am working on a web app that needs to display streaming video of
We have an app that needs to access network resources. It's written in VB.Net.
I have an app that needs to be able use either an sqlite3 datebase
I have an app that needs backgrounds for both parts of the split view.
I have a Rails app that needs to expose values from a database as
I have a wpf app that needs to communicate(exchange data) with a custom designed

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.