android - How to launch an List fragment activity from Normal activity using On Click of Button -


i have created app many list fragments in it. works fine. have main application in want merge new list fragment app. have included activity in android manifest well. below main activity of listfragment app, xml have 3 fragments , nothing else.

@override public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.main);     ctx1 = getapplicationcontext(); } 

in main app have several buttons, launches different activities on click.

how launch list fragment using 1 of button.

i did use:

intent listactivity= new intent(mainactivity.this, testlistfragmentmain.class);         startactivity(listactivity); 

but above code gives me inflating exceptions :( there easy way this? please reply

trace logs:

d/dalvikvm( 1478): gc_concurrent freed 140k, 14% free 7493k/8707k, paused 13ms+0ms, total 76ms  d/androidruntime( 1478): shutting down vm  w/dalvikvm( 1478): threadid=1: thread exiting uncaught exception (group=0xa631d288)  e/androidruntime( 1478): fatal exception: main  e/androidruntime( 1478): java.lang.runtimeexception: unable start activity componentinfo{org.droidtv.tvplayerfunctionaltestapp/org.droidtv.tvplayerfunctionaltestapp.androidlistfragmentactivity}: android.view.inflateexception: binary xml file line #7: error inflating class fragment  e/androidruntime( 1478):    @ android.app.activitythread.performlaunchactivity(activitythread.java:2059)  e/androidruntime( 1478):    @ android.app.activitythread.handlelaunchactivity(activitythread.java:2084)  e/androidruntime( 1478):    @ android.app.activitythread.access$600(activitythread.java:130)  e/androidruntime( 1478):    @ android.app.activitythread$h.handlemessage(activitythread.java:1195)  e/androidruntime( 1478):    @ android.os.handler.dispatchmessage(handler.java:99)  e/androidruntime( 1478):    @ android.os.looper.loop(looper.java:137)  e/androidruntime( 1478):    @ android.app.activitythread.main(activitythread.java:4745)  e/androidruntime( 1478):    @ java.lang.reflect.method.invokenative(native method)  e/androidruntime( 1478):    @ java.lang.reflect.method.invoke(method.java:511)  e/androidruntime( 1478):    @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786)  e/androidruntime( 1478):    @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553)  e/androidruntime( 1478):    @ dalvik.system.nativestart.main(native method)  e/androidruntime( 1478): caused by: android.view.inflateexception: binary xml file line #7: error inflating class fragment  e/androidruntime( 1478):    @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:704)  e/androidruntime( 1478):    @ android.view.layoutinflater.rinflate(layoutinflater.java:746)  e/androidruntime( 1478):    @ android.view.layoutinflater.inflate(layoutinflater.java:489)  e/androidruntime( 1478):    @ android.view.layoutinflater.inflate(layoutinflater.java:396)  e/androidruntime( 1478):    @ android.view.layoutinflater.inflate(layoutinflater.java:352)  e/androidruntime( 1478):    @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:256)  e/androidruntime( 1478):    @ android.app.activity.setcontentview(activity.java:1952)  e/androidruntime( 1478):    @ org.droidtv.tvplayerfunctionaltestapp.androidlistfragmentactivity.oncreate(androidlistfragmentactivity.java:18)  e/androidruntime( 1478):    @ android.app.activity.performcreate(activity.java:5098)  e/androidruntime( 1478):    @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1079)  e/androidruntime( 1478):    @ android.app.activitythread.performlaunchactivity(activitythread.java:2023)  e/androidruntime( 1478):    ... 11 more  e/androidruntime( 1478): caused by: android.support.v4.app.fragment$instantiationexception: unable instantiate fragment org.droidtv.videofeaturingtestapp.videofeaturingmainmenuclass: make sure class name exists, public, , has empty constructor public  e/androidruntime( 1478):    @ android.support.v4.app.fragment.instantiate(fragment.java:401)  e/androidruntime( 1478):    @ android.support.v4.app.fragment.instantiate(fragment.java:369)  e/androidruntime( 1478):    @ android.support.v4.app.fragmentactivity.oncreateview(fragmentactivity.java:272)  e/androidruntime( 1478):    @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:676) 

i might had missed step , when did whole thing again working fine. used normal intent method launch new activity


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -