Android Application Development Cookbook: 93 Recipes for Building Winning Apps



Download 32,34 Mb.
Pdf ko'rish
bet39/56
Sana26.02.2022
Hajmi32,34 Mb.
#470540
1   ...   35   36   37   38   39   40   41   42   ...   56
Bog'liq
Android Application Development Cookbook

34

ChAPter 1
Android FundAmentAls

android:name=".MyBrowserActivity"
android:label="@string/app_name" >









Note the elements contained within the 

element for the 
MyBrowserActivity
class. It has two actions: 
android.intent.action.VIEW
and 
net.learn2develop.MyBrowser

This means that it can be called using the 
android.intent.action.VIEW
action constant, or 
directly using the 
net.learn2develop.MyBrowser
name. It also specifies the data scheme of 
http:

This means that this activity requires data passed to it to have the 
http:
prefix, such as 
http://
www.amazon.com

http://www.google.com
, and 
http://www.wrox.com

To invoke the 
MyBrowserActivity
class, you can use the following statements in your main 
activity:
package net.learn2develop.intentfilters;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent i = new Intent("net.learn2develop.MyBrowser");
i.setData(Uri.parse("http://www.amazon.com"));
startActivity(i);
}
}
Figure 1-20 shows the 
MyBrowserActivity
class displaying the Amazon.com site. In this case, 
you are directly calling the 
MyBrowserActivity 
class using its “
net.learn2develop.MyBrowser
” 
action.
www.it-ebooks.info



Download 32,34 Mb.

Do'stlaringiz bilan baham:
1   ...   35   36   37   38   39   40   41   42   ...   56




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish