android - how to call an activity which extends the baseactivity -
I am writing an activity class like the following
to the public class's headerfooter activity Enhances {Public Zero on Crate (Bundled Saved Instance) {Super. Contents (Saved Instance State); SetContentView (R.layout.headerfooter); }} and I'm expanding another class from the headerfooter class
extends the public class home headerfruit {@Override on public zeros Create (bundle savedinstenstate) {super .onCreate (savedInstanceState); ViewGroup vg = (ViewGroup) findViewById (R.id.lldata); ViewGroup.inflate (Home.this, R.layout.home, vg); }} How to call extended classes from the base class on the listitemclick event
If I try the following code
Intent I = new intent (headfactor, this, home class); StartActivity (i); I'm getting an exception Tell me how to call Extended Class from my main category.
Exception Description:
03 - 21 07: 17: 44.173: E / AndroidRuntime (1522): Severe Exception: Chief 03-21 July: 17: 44.173: E / AndroidRuntime (1522): java.lang.RuntimeException: Activity ComponentInfo {com.pcmac is unable to start. Parentconnect / com.pcmac.parentconnect.Grades}: java.lang.NullPointerException 03-21 07: 17: 44.173: E / AndroidRuntime (1522): android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2180) 03-21 07: 17: 44.173: E / AndroidRuntime (1522): android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2230) 03-21 July: 17: 44.173: E / AndroidRuntime (1522): android.app.ActivityThread . $ 600 (ActivityThread.java:141) 03-21 07: 17: 44.173: E / Android Random (1522): On Android. ActiveTrade $ H Holland Message (ActivityTrad.Java 1234) 03-21 07:17: 44.173: E / Android Rendime (1522): Android.OSHandler Disappemessage (handler.java: 99) 03-21 07: 17: 44.173: E / Android IdRuntime (1522): at android.os.Looper.loop (Looper.java:137) 03-21 07: 17: 44.173: E / AndroidTime (1522): Android.AP.Activatitrad.Mine (ActivityThoughJavadel 50) 03-21 07: 17: 44.173: E / Android Random (1522): at java.lang.reflect.Method.invokeNative (Basic Method) 03-21 07: 17: 44.173: E / Android Time (1522): lang.reflect.Method.invoke (Method.java: 1111) on 03-21 July: 17: 44.173: E / AndroidRuntime (1522): com. Android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:793) 03-21 07: 17: 44.173: E / Android Rendime (1522): com.android.internal.os.ZygoteInit.main (Zigoteinit. JAVA Pratap 60) 03-21 07: 17: 44.173: E / Android Time (1522): On Dalvik.system.NativeStart.main (native method) 03-21 07: 17: 44.173: E / Androindertime (1522) ): By: java.lang.NullPointerException 03-21 07: 17: 44.173: E / Android TimeTime (1522): 17: 44.173: E / AndroidRuntime (1522): com.pcmac.parentconnect.Grades.onCreate at (grade com. Pcmac.parentconnect.LayerStack.onCreate (LayerStack.java:174) on 03-21 July. Java: 15) 03-21 07: 1 7: 44.173: E / Android Random (1522): Android. App Activity.Perform Create (Activity. JavaTT 104) 03-21 07: 17: 44.173: E / Android Time (1522): Android.AP Instrumentation. Call activiton crat (Instrumentation.java:1080) 03-21 July: 17: 44.173: E / AndroidRuntime (1522): android.app.ActivityThread.performLaunchActivity (ActivityThread.java, 1414) 03-21 July: 17: 44.173: E / AndroidRuntime (1522): ... 11 more
In this case , You want to use other creators of the intent:
intent = new intent (); I.setClassName (reference, getTargetActivityClassName () / * override this method to hair class and return string * /);
Comments
Post a Comment