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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:05:35+00:00 2026-05-31T07:05:35+00:00

I am creating an app that allows college students to download their study material

  • 0

I am creating an app that allows college students to download their study material from within the app instead of the browser.
The home page has lots of subject names.
Each subject name leads to new webpage.
So, I have used WebViewClient.
But, at the final page when I click on the *.ppt or *.pdf files it opens junk.

I want these files to be downloaded within the app.

How do I implement DownloadListener

package jiit.app;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class sm extends Activity
{  
    WebView browser;

    protected void onCreate(Bundle anyvar) 
    {
        super.onCreate(anyvar);
        setContentView(R.layout.sm);
        browser=(WebView)findViewById(R.id.webkit);
        WebSettings webSettings = browser.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webSettings.setBuiltInZoomControls(true);
        browser.getSettings().setDefaultZoom(WebSettings.ZoomDensity.CLOSE);
        browser.setWebViewClient(new WebViewClient());
        {
            browser.loadUrl("http://www.sm.ividhya.com/j128/");
        }  
    }
}
  • 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-05-31T07:05:36+00:00Added an answer on May 31, 2026 at 7:05 am

    try this DownloadListener example :

    public class webActivity  extends Activity {
    
     WebView webView;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            this.webView=(WebView) this.findViewById(R.id.webview);
            this.webView.getSettings().setSupportZoom(false);
            this.webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
            this.webView.loadUrl("http://www.sm.ividhya.com/j128/");
            this.webView.setWebViewClient(new WebViewClientDemo());
            webView.setDownloadListener(new DownloadListener() {
                public void onDownloadStart(String url, String userAgent,
                                String contentDisposition, String mimetype,
                                long contentLength) {
    
                                              Uri uri = Uri.parse(url);
               Intent intent = new Intent(Intent.ACTION_VIEW,uri);
                        startActivity(intent);
                }
        });
    
        }
      private class WebViewClientDemo extends WebViewClient {
        @Override
    
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
         view.loadUrl(url);
          return true;
         }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a home automation app that has allows plugin views. I have
I am creating a home automation app that has allows plugin views. I have
I'm working on creating a Rails app that allows users to set availability Sunday
I'm creating a web app that allows users to enter a number of colors,
So I'm creating a django app that allows a user to add a new
I am creating an app that allows the user to do some hand-drawing. The
I'm creating an app that allows users to query, manipulate, and explore a very
I'm working on creating an app that allows very low bandwidth communication via high
I have an app that allows the user to move from a list of
I'm creating an app for the android OS that allows the user to pick

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.