Enable Download in Webview

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Enable Download in Webview

Postby footiepal » Thu Mar 08, 2012 7:34 pm

hello Devs,
right, im not gonna lie, im a noobie. but please can someone help me? short story: i have an website, with some made by me live wallpapers, so i decided to make a mobile site with direct download from it and an app in webview to that site. the site is www.footiepal.com . but im facing a problem. my webview browser dosnt download any .apk files. everything is working with a stock browser.

thanks a lot. so far i have a code:
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.WebView;

public class FootiepalActivity extends Activity {
WebView ourBrow;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

ourBrow = (WebView) findViewById(R.id.wvBrowser);
ourBrow.getSettings().setJavaScriptEnabled(true);
ourBrow.getSettings().setLoadWithOverviewMode(true);
ourBrow.getSettings().setUseWideViewPort(true);
ourBrow.setWebViewClient(new ourViewClient());
try{
ourBrow.loadUrl("http://www.footiepal.com");
}catch (Exception e){
e.printStackTrace();
}

}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && ourBrow.canGoBack()) {
ourBrow.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}
footiepal
Freshman
Freshman
 
Posts: 2
Joined: Thu Mar 08, 2012 7:20 pm

Top

Re: Enable Download in Webview

Postby footiepal » Thu Mar 08, 2012 8:28 pm

Please enyone?
footiepal
Freshman
Freshman
 
Posts: 2
Joined: Thu Mar 08, 2012 7:20 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: Google [Bot] and 10 guests