You are on page 1of 9

4/15/2016

android fragments interview questions and answers paper 418 - skillgun

SKILLGUN
Test & Improve your skills

(/Home.aspx)
First time user? Register (/RegisterUser.aspx) | Sign In (/Login.aspx)

Selectchapter
Android

All(33.Papers)(http://skillgun.com/android/interviewquestionsandanswers)
basics(6.Papers)(http://skillgun.com/android/basics/interviewquestionsandanswers)
activities(5.Papers)(http://skillgun.com/android/activities/interviewquestionsandanswers)
services(2.Papers)(http://skillgun.com/android/services/interviewquestionsandanswers)
threads(2.Papers)(http://skillgun.com/android/threads/interviewquestionsandanswers)
receivers(1.Papers)(http://skillgun.com/android/receivers/interviewquestionsandanswers)
contentproviders(2.Papers)(http://skillgun.com/android/contentproviders/interviewquestionsandanswers)
advancedandroid(2.Papers)(http://skillgun.com/android/advancedandroid/interviewquestionsandanswers)
NFC&SerialPort(1.Papers)(http://skillgun.com/android/nfcserialport/interviewquestionsandanswers)
SQLitedatabase(1.Papers)(http://skillgun.com/android/sqlitedatabase/interviewquestionsandanswers)
locationmanagerandsensors(1.Papers)(http://skillgun.com/android/locationmanagerandsensors/interviewquestionsand
answers)
adapters(1.Papers)(http://skillgun.com/android/adapters/interviewquestionsandanswers)
graphicsandanimations(1.Papers)(http://skillgun.com/android/graphicsandanimations/interviewquestionsandanswers)
adbandddms(1.Papers)(http://skillgun.com/android/adbandddms/interviewquestionsandanswers)
HttpandWebServers(2.Papers)(http://skillgun.com/android/httpandwebservers/interviewquestionsandanswers)
widgets(1.Papers)(http://skillgun.com/android/widgets/interviewquestionsandanswers)
fragments(1.Papers)(http://skillgun.com/android/fragments/interviewquestionsandanswers)
securitiesandpermissions(1.Papers)(http://skillgun.com/android/securitiesandpermissions/interviewquestionsandanswers)
Telephonymanager(1.Papers)(http://skillgun.com/android/telephonymanager/interviewquestionsandanswers)
UI(1.Papers)(http://skillgun.com/android/ui/interviewquestionsandanswers)
Hide

Fresherinterviewquestions

Experiencedinterviewquestions ?

SponsoredLinks

http://skillgun.com/android/fragments/interview-questions-and-answers/paper/418

1/9

4/15/2016

android fragments interview questions and answers paper 418 - skillgun

Autodesk
Fusion
360

TheNext
Generation
Designool.
Freefor
Students.
Download
Now.

autodesk.com/Fusion3

Businessmovesfast.Youcanmovefaster
with UCSServersfromCisco.
Home(http://skillgun.com/home.aspx)>Technical(http://skillgun.com/technical/interviewquestionsandanswers)>Android
(http://skillgun.com/android/interviewquestionsandanswers)>Paper19
Readmorepapers: 16(http://skillgun.com/android/fragments/interviewquestionsandanswers/paper/428) 17
(http://skillgun.com/android/fragments/interviewquestionsandanswers/paper/415) 18
(http://skillgun.com/android/fragments/interviewquestionsandanswers/paper/33) 19
(http://skillgun.com/android/fragments/interviewquestionsandanswers/paper/418) 20
(http://skillgun.com/android/fragments/interviewquestionsandanswers/paper/276)
(http://skillgun.com/android/fragments/onlinetest/paper/418)
1.ShowQuestionsonly

? 1.Important

? SubmitaQuestion(/SubmitQuestions.aspx) Submit

Paper(/SubmitPaper.aspx)

0SaysImportant
0PeopleLikeit
RateToughness

1 WhatistrueaboutaFragment?
(http://skillgun.com/question/395/android/fragments/whatistrueaboutafragment)
Toughness
A.IcanuseaFragmentwithoutanActivity.
http://skillgun.com/android/fragments/interview-questions-and-answers/paper/418

2/9

4/15/2016

android fragments interview questions and answers paper 418 - skillgun

B.Afragmentcanhavemultipleactivitiesinit.
C.Anactivitycancontainmultiplefragmentsinit.
D.Afragmentdesignedinoneactivitycan'tbereusedinotheractivity.

CloseAnswer

Shareiton

Answer:
(C) Anactivitycancontainmultiplefragmentsinit.
Description:
0Comments

StartDiscussion(http://skillgun.com/question/395/android/fragments/whatistrueaboutafragment)

Tellus
Submitnewquestion (http://skillgun.com/SubmitQuestions.aspx)
Questioniswrong (http://skillgun.com/TellUsAboutQuestion.aspx?
Question=true&q_id=395&p_id=418&typeid=0&count=19&topic_name=Android)
Answeriswrong (http://skillgun.com/TellUsAboutQuestion.aspx?
Answer=true&q_id=395&p_id=418&typeid=0&count=19&topic_name=Android)
Explanationiswrong (http://skillgun.com/TellUsAboutQuestion.aspx?
explanation=true&q_id=395&p_id=418&typeid=0&count=19&topic_name=Android)

0SaysImportant
0PeopleLikeit
RateToughness

2 Whenactivityismovedtostoppedstate,thenwhatwillhappentothelifecycleofafragmentwhichisin

thatactivity?
(http://skillgun.com/question/396/android/fragments/whenactivityismovedtostoppedstatethenwhatwillhappentothelife
cycleofafragmentwhichisinthatactivity)
Toughness
A.fragmentslifecycleisnotdependentonactivity's.Sotherewon'tbeanyeffectforfragmentlifecycle.
B.Option1istruebecausefragmentsareindependentmodulesdesignedforbetterspaceusage
C.fragmentswillbemovedtoonStop
D.bothfragmentswillbedestroyedandrecreatedwhenactivityreachesonResumeagain.

ShowAnswerandExplanation

Shareiton

0SaysImportant
0PeopleLikeit
RateToughness

Experiencedinterviewquestion
3

http://skillgun.com/android/fragments/interview-questions-and-answers/paper/418

3/9

4/15/2016

android fragments interview questions and answers paper 418 - skillgun

WhatisaFragment,inandroid?
i.FragmentsaredesignedtousethedeviceUIspaceefficiently.
ii.Fragmentsaredesignedasareusablecomponentsformultipleactivities.
iii.Fragmentwillhaveitsownlifecycle,whichwillnotdependentonActivity'slifecycle.
iv.Fragmentwillhaveitsownlifecycle,whichwillbeaffectedbyActivity'slifecycleaswell.
(http://skillgun.com/question/397/android/fragments/whatisafragmentinandroidifragmentsaredesignedtousethedeviceui
spaceefficientlyiifragmentsaredesignedasareusablecomponentsformultipleactivitiesiiifragmentwillhaveitsownlife
cyclewhichwillnotdependentonactivitys)
Toughness
A.i
B.i&ii
C.i,ii,&iii
D.i,ii,&iv

CloseAnswer

Shareiton

Answer:
(D) i,ii,&iv
Description: Fragmentsisanewconceptintroducedin3.0version.
Thebasicpurposeoffragmentsis:
1.FragmentsaredesignedtousethedeviceUIspaceefficiently.
Whenyouarewritinganapplicationinandroid,thensomepeoplecandownloaditintophone,someintotablets.Ifyou
seethespaceintabletsitwillbelittlebiggerthanphones.Youshouldbeabletousethatspaceefficiently.Butyoucan't
keepwritingdifferentapplicationsonetargetingforphone,andothertargetingfortablets.Inordertodoitefficiently,i.e
writingonlyapplicationthatcanfitwellwithallscreensizes,weusefragmentsconcept.
2.fragmentsaredesignedasareusableUIcomponentsbetweenmorethanoneactivity.
Onceyoudesignafragment,youcanviewitasadetachableindependentunit,sothatyoucanplugitintoanyactivity
whereeverthereisaspace.Thatmeansyoucanreusethecodedesignedforafragment.
Fragmentyoucanthinkofitlikeasubactivity,whichsitswithinanactivityandwhichcontributesitsownUItotheactivity
screen.
Fragmentsarealwayspartofanactivity.Withoutanactivity,afragmentwillnotexist.Soyourfragmentlifecyclewill
alwaysbeaffectedbyactivitylifecycle.
Anactivitycancontainmorethanonefragment.Similarlyafragmentcanbereusedinmultipleactivities.
0Comments

StartDiscussion(http://skillgun.com/question/397/android/fragments/whatisafragmentinandroidi
fragmentsaredesignedtousethedeviceuispaceefficientlyiifragmentsaredesignedasa
reusablecomponentsformultipleactivitiesiiifragmentwillhaveitsownlifecyclewhichwillnot
dependentonactivitys)

Tellus
Submitnewquestion (http://skillgun.com/SubmitQuestions.aspx)
Questioniswrong (http://skillgun.com/TellUsAboutQuestion.aspx?
Question=true&q_id=397&p_id=418&typeid=0&count=19&topic_name=Android)
Answeriswrong (http://skillgun.com/TellUsAboutQuestion.aspx?
Answer=true&q_id=397&p_id=418&typeid=0&count=19&topic_name=Android)
Explanationiswrong (http://skillgun.com/TellUsAboutQuestion.aspx?
explanation=true&q_id=397&p_id=418&typeid=0&count=19&topic_name=Android)
http://skillgun.com/android/fragments/interview-questions-and-answers/paper/418

4/9

4/15/2016

android fragments interview questions and answers paper 418 - skillgun

0SaysImportant
0PeopleLikeit
RateToughness

4 Howtofindafragmentinanactivity?
(http://skillgun.com/question/398/android/fragments/howtofindafragmentinanactivity)
Toughness
A.findViewById(R.id.frag_id)
B.FragmentManager.findFragmentById(R.id.frag_id)
C.LayoutManager.findFragmentManager(R.id.frag_id)
D.Context.findFragmentById(R.id.frag_id)

ShowAnswerandExplanation

Shareiton

1SaysImportant
0PeopleLikeit
RateToughness

Experiencedinterviewquestion
5 Howtocreatedifferentlayoutfilesportraitandlandscapeorientations?
(http://skillgun.com/question/399/android/fragments/howtocreatedifferentlayoutfilesportraitandlandscapeorientations)
Toughness
A.itisnotpossible.
B.puttwodifferentfilesinlayoutfolder,useoneforportraitandotherforlandscape,basedonorientationchange.
C.uselayoutportfolderforportraitmode,andlayoutlandforlandscapemode.
D.uselayoutportfolderforportraitmode,andlayoutfolderforlandscapemode.

ShowAnswerandExplanation

Shareiton

0SaysImportant
0PeopleLikeit
RateToughness

6 Howtoreturnlayoutofafragment?WhichfunctiontoimplementinFragmentclassforit?
(http://skillgun.com/question/400/android/fragments/howtoreturnlayoutofafragmentwhichfunctiontoimplementinfragment
classforit)
Toughness
A.onCreate()
B.onCreateView()
C.getView()
D.getFragmentView()

ShowAnswerandExplanation

http://skillgun.com/android/fragments/interview-questions-and-answers/paper/418

Shareiton

5/9

4/15/2016

android fragments interview questions and answers paper 418 - skillgun

0SaysImportant
0PeopleLikeit
RateToughness

7 IsitpossibletohavefragmentswithoutUI,inandroid?
(http://skillgun.com/question/401/android/fragments/isitpossibletohavefragmentswithoutuiinandroid)
Toughness
A.FragmentwillneverhaveanyUI.
B.FragmentgenerallywillcontributeitsUIbyusingitsownlayout.ButitmightnothaveUIinsomecases,asitisnot
mandatory.
C.Bothoption1&2areright.
D.noneoftheabovearetrue.BecausefragmentsshouldalwayshaveitsownlayoutandcontributeitsUI.

ShowAnswerandExplanation

Shareiton

0SaysImportant
0PeopleLikeit
RateToughness

8 Howtocreateanactivitywhichhasfragmentwithlistview?
(http://skillgun.com/question/403/android/fragments/howtocreateanactivitywhichhasfragmentwithlistview)
Toughness
A.useActivity,fragment,alayoutwhichwillhavelistview.
B.useactivity&aListFragment
C.UseonlyActivitywithalayoutwhichishavingalistviewinit.
D.UseonlyaListFragmentwithoutanyactivity.

ShowAnswerandExplanation

Shareiton

0SaysImportant
0PeopleLikeit
RateToughness

9 WhichofthebelowisnotaFragmentclass.
(http://skillgun.com/question/404/android/fragments/whichofthebelowisnotafragmentclass)
Toughness
A.Fragment
B.DialogFragment
C.PreferenceFragment
D.ActivityFragment

ShowAnswerandExplanation

Shareiton

0SaysImportant
0PeopleLikeit
RateToughness

http://skillgun.com/android/fragments/interview-questions-and-answers/paper/418

6/9

4/15/2016

android fragments interview questions and answers paper 418 - skillgun

10 WhichofthebelowfunctionsarenotpartofFragmentlifecycle?
(http://skillgun.com/question/405/android/fragments/whichofthebelowfunctionsarenotpartoffragmentlifecycle)
Toughness
A.onCreateView()
B.onDetach()
C.onActivityDestroyed()
D.onActivityCreated()

ShowAnswerandExplanation

Shareiton

0SaysImportant
0PeopleLikeit
RateToughness

11 WhichofthebelowarecorrectsequenceofFragmentlifecycle?
(http://skillgun.com/question/406/android/fragments/whichofthebelowarecorrectsequenceoffragmentlifecycle)
Toughness
A.onAttach()
onCreate()
onCreateView()
onStart()
onActivityCreated()
onResume()
B.onAttach()
onCreateView()
onCreate()
onActivityCreated()
onStart()
onResume()
C.onAttach()
onCreate()
onCreateView()
onStart()
onActivityCreated()
onResume()
D.onAttach()
onCreate()
onCreateView()
onActivityCreated()
onStart()
onResume()

ShowAnswerandExplanation

Shareiton

0SaysImportant
0PeopleLikeit
RateToughness

12 SupposeXisafragmentactivity,YandZarefragmentswhereYisthedefaultscreendisplayed.Ifwehave

toopenZ,then
(http://skillgun.com/question/5785/android/fragments/supposexisafragmentactivityyandzarefragmentswhereyisthe
defaultscreendisplayedifwehavetoopenzthen)
Toughness
A.YmustusefragmentmanagertoopenscreenZ.
B.YmustuseintenttoopenthescreenZ.
http://skillgun.com/android/fragments/interview-questions-and-answers/paper/418

7/9

4/15/2016

android fragments interview questions and answers paper 418 - skillgun

C.YmustusefragmenttransactionwithfragmentmanagerandreplaceitselfwithscreenZ.
D.Nonearecorrect.

ShowAnswerandExplanation

Shareiton

0SaysImportant
0PeopleLikeit
RateToughness

13 Whatisafragmentinandroid?
(http://skillgun.com/question/6689/android/fragments/whatisafragmentinandroid)
Toughness
A.Fragmentisapartofanactivity,whichcontributesitsownUItothatactivity.Fragmentcanbethoughtlikeasub
activity.
B.Fragmentsareusedtoefficientlyusethespaceinwiderscreendevices.
C.Anactivitymaycontain0ormultiplenumberoffragmentsbasedonthescreensize.Afragmentcanbereusedin
multipleactivities,soitactslikeareusablecomponentinactivities.
D.allaretrue

ShowAnswerandExplanation

Shareiton

0SaysImportant
0PeopleLikeit
RateToughness

14 Whatisthedifferencebetweenactivityandfragmentinandroid?
(http://skillgun.com/question/6690/android/fragments/whatisthedifferencebetweenactivityandfragmentinandroid)
Toughness
A.fragmentisapartofanactivity,whichcontributesitsownUItothatactivity.Fragmentcanbethoughtlikeasub
activity.Whereasthecompletescreenwithwhichuserinteractsiscalledasactivity.Anactivitycancontain
multiplefragments.Fragmentsaremostlyasubpartofanactivity.
B.Anactivitymaycontain0ormultiplenumberoffragmentsbasedonthescreensize.Afragmentcanbereusedin
multipleactivities,soitactslikeareusablecomponentinactivities.
C.Afragmentcan'texistindependently.Itshouldbealwayspartofanactivity.Whereasactivitycanexistwithout
anyfragmentinit.
D.allaretrue

ShowAnswerandExplanation

Shareiton

0SaysImportant
0PeopleLikeit
RateToughness

15 Whyfragmentsinandroid?Whatistheuse?
(http://skillgun.com/question/6691/android/fragments/whyfragmentsinandroidwhatistheuse)
Toughness
A.Fragmentsareusedtoefficientlyusethespaceonwiderscreendevices.
B.fragmentsareusedasameansofsolvingcompatibilityissueswhentargetinganandroidapplicationforvarious
screensizes,espforbothtabletsandmobiles.
http://skillgun.com/android/fragments/interview-questions-and-answers/paper/418

8/9

4/15/2016

android fragments interview questions and answers paper 418 - skillgun

C.FragmentscanbeusedtoreusethesamepieceofUItemplateinmultipleactivities,withoutrewritingtheentire
code.Thesearekindofreusablecomponentswhichfitsintoanactivity.
D.allaretrue

ShowAnswerandExplanation

Shareiton

Readmorepapers: 16(http://skillgun.com/android/fragments/interviewquestionsandanswers/paper/428) 17
(http://skillgun.com/android/fragments/interviewquestionsandanswers/paper/415) 18(http://skillgun.com/android/fragments/interview
questionsandanswers/paper/33) 19(http://skillgun.com/android/fragments/interviewquestionsandanswers/paper/418) 20
(http://skillgun.com/android/fragments/interviewquestionsandanswers/paper/276)

AutodeskFusion
360
TheNextGenerationDesign
ool.FreeforStudents.
DownloadNow.

autodesk.com/Fusion360
2014PalleTechnologiesTermsofService(/Termsofservice.aspx)PrivacyPolicy(/PrivacyPolicy.aspx)AboutUs(/AboutUs.aspx)
ReportBug(/Reportbug.aspx)
Bookmarkto

http://skillgun.com/android/fragments/interview-questions-and-answers/paper/418

9/9

You might also like