4 ŞUBAT 2010, PERŞEMBE
Nasıl Android bir URL açmak'benim uygulama web tarayıcı s miyim?
Nasıl dahili web tarayıcı kodu bir URL açmak yerine benim uygulama içinde?
Bunu denedim:
try {
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(download_link));
startActivity(myIntent);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, "No application can handle this request."
" Please install a webbrowser", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
ama bir İstisna var:
No activity found to handle Intent{action=android.intent.action.VIEW data =www.google.com
CEVAP
4 ŞUBAT 2010, PERŞEMBE
Bunu deneyin:
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(browserIntent);
Bu benim için gayet iyi çalışıyor.
Kayıp "://" böyle bir şey yapardım: . http gelince
if (!url.startsWith("http://") && !url.startsWith("https://"))
url = "http://" url;
Ayrıca muhtemelen kullanıcı bir URL yazma-önceden doldur senin EditText isterim "http://".
Bunu Paylaş:
Bir tarayıcı açmak yerine uygulama yön...
Nasıl benim Uygulama Android tarafında...
Nasıl benim Android uygulaması e-posta...
Nasıl Google Play Store doğrudan benim...
Nasıl benim Android cihazdan benim loc...