Professional Documents
Culture Documents
Android Fragments Interview Questions and Answers Paper 418 - Skillgun
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
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
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
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
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
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
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
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
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